File Upload Error - Bad Gateway

Thread is closed for posting
3 posts, 0 answers
  1. Prashant
    Prashant avatar
    2 posts
    Member since:
    Apr 2014

    Posted 30 Jun 2015 Link to this post


    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. Prashant
    Prashant avatar
    2 posts
    Member since:
    Apr 2014

    Posted 30 Jun 2015 in reply to Prashant Link to this post

    I am working Xamarin.Forms shared project.
  3. Anton Dobrev
    Anton Dobrev avatar
    609 posts

    Posted 02 Jul 2015 Link to this post


    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.

    Anton Dobrev
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
Back to Top