This is a migrated thread and some comments may be shown as answers.

File Upload Error - Bad Gateway

2 Answers 251 Views
.NET SDK
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Prashant
Top achievements
Rank 1
Prashant asked on 30 Jun 2015, 07:17 AM

 Hello

I am trying to upload a file ("abc.jpg") using Telerik.Everlive.SDK library but getting error bad gateway.

Here is my code - 

 var fileField = new Telerik.Everlive.Sdk.Core.Query.Definition.FormData.FileField("file","abc.jpg","image/jpeg", stream);

 var result = EverliveAppContext.WorkWith().Files().Upload(fileField).ExecuteSync();

I am getting following exception while executing above code - 

"Telerik.Everlive.Sdk.Core.Transport.EverliveException: <html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway.\n  at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x0033b] in <filename unknown>:0 \n  at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00165] in <filename unknown>:0 \n  --- End of inner exception stack trace ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in <filename unknown>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <filename unknown>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <filename unknown>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <filename unknown>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter`1[Telerik.Everlive.Sdk.Core.Model.Result.CreateResultItem].GetResult () [0x00000] in <filename unknown>:0 \n  at Stream.Data.Repository+Files+<UploadFileAsync>d__1.MoveNext () [0x0008f] in e:\\PROJECTS\\GIT\\StreamLive\\common\\Entities\\Repository.cs:218 "

--

Can anybody help?

Thank you,

Prashant Pandey

2 Answers, 1 is accepted

Sort by
0
Prashant
Top achievements
Rank 1
answered on 01 Jul 2015, 04:25 AM
I am working Xamarin.Forms shared project.
0
Anton Dobrev
Telerik team
answered on 02 Jul 2015, 12:44 PM
Hi,

Could you check the request made by your application (for example, with a tool like Fiddler) to capture the correct message returned by the server.

Also, could you check that:
 - the request is not timing out - how long does it take to receive this error?
 - the request (anonymous or personalized) is allowed to upload Files (e.g. create) in the Permissions for the Files installment in your Backend Services project.

If this does not fix the issue, please, provide a simple example that illustrates it in this thread and we will be able to take a look into it.

Since, the .NET SDK build is not explicitly tested with Xamarin, would you mind testing the same code in a .NET project of your choice (Windows Phone, ASP.NET, etc.)?

I look forward to your reply.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
Tags
.NET SDK
Asked by
Prashant
Top achievements
Rank 1
Answers by
Prashant
Top achievements
Rank 1
Anton Dobrev
Telerik team
Share this question
or