locked
504 Gateway Timeout using BackgroundUploader

    Question

  • I'm trying to use a BackgroundUploader to send a video file using a multi-part form and POST.  When the network upload speed is high enough, the POST works fine.  However, at more normal network speeds, I get a 504 Gateway Timeout.  The C# sample code I'm working from uses a HttpClient client, and sets client.Timeout to a high enough value so that the 504 timeout doesn't occur.  Is there something equivalent for BackgroundUploader / C++?

    Andrea Mantler

    Monday, May 06, 2013 7:31 PM

Answers

  • I ended up writing three implementations, all of which had the same problem.  It turns out the site I was communicating with needed some settings changed on their server.

    Andrea Mantler

    Wednesday, June 05, 2013 4:24 PM

All replies

  • Maybe you can try  XML HTTP Request as httpclient

    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh770550

     

    Also, you can test this sample to make sure if your has problem on codes.

    http://code.msdn.microsoft.com/windowsapps/Background-Transfer-Sample-d7833f61

     

    Best regards,

    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, May 08, 2013 4:40 AM
  • I used the Background Transfer Sample as an example when I was writing my code.  My code works for shorter videos and higher speed networks, the problem is with the timeout on the slower networks.  I looked in that example, but it didn't seem to have anything for changing the length of the timeout.

    The problem with IXMLHTTPRequest2 is that I'm sending a multi-part form, and, unlike the BackgroundTransfer classes which has BackgroundTransferContentPart, IXMLHTTPRequest2 has no built-in support for mulit-part forms.  (Well, not that I know of...)  I would need to do all of the encoding of the POST by hand. The form I need to submit has multiple text portions, and two data streams, which I think would be a headache to encode.

    Do you know if IXMLHTTPRequest2 has support for multi-part forms?  If it does have support, I think XHR_PROP_TIMEOUT might do what I need.

    Is there really no way to specify the timeout period for the BackgroundUploader?  Given that it was meant for larger transfers, it seems strange that there's no way to specify a longer timeout period.


    Andrea Mantler

    Wednesday, May 08, 2013 5:00 AM
  • I ended up writing three implementations, all of which had the same problem.  It turns out the site I was communicating with needed some settings changed on their server.

    Andrea Mantler

    Wednesday, June 05, 2013 4:24 PM