1
votes

I have a form that contains some upload fields. From most locations the form performs without issues. But for some locations (so far I've experienced it personally in 2 different places in Singapore) the form almost always times out when submitted, even the file upload fields are left empty. If I remove the upload fields the the form works fine for these locations too.

I've traced the requests as follows. On the form without the fields that works fine:

Request URL:http://opentraits.com/bogdan-litescu/communities/new2 Request Method:POST Status Code:302 Found Request Headersview source Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Cache-Control:max-age=0 Connection:keep-alive Content-Length:1180 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryijq2AW8yKt0E8wSc Cookie:ASP.NET_SessionId=...... Host:opentraits.com Origin:http://opentraits.com Referer:http://opentraits.com/bogdan-litescu/communities/new2 User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17 Request Payload ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="Id"

0 ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="Name"

ewfwefwevv ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="Website"

------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="About"

------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IterationEnabled"

false ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IterationNextStart"

2013-01-28 ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IterationLength"

2 ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IterationPause"

0 ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IterationTotalPoints"

10 ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IterationPointScale"

0,1,2,3 ------WebKitFormBoundaryijq2AW8yKt0E8wSc Content-Disposition: form-data; name="IncentivesEnabled"

false ------WebKitFormBoundaryijq2AW8yKt0E8wSc-- Response Headersview source Cache-Control:private, s-maxage=0 Content-Length:143 Content-Type:text/html; charset=utf-8 Date:Mon, 21 Jan 2013 14:53:20 GMT Location:/bogdan-litescu/ewfwefwevv P3P:CP: NOI ADM DEV COM NAV OUR STP Server:Microsoft-IIS/8.0 Set-Cookie:.ASPXAUTH=BE19A758026293C73831096A1D96D428C08C60C45D20CDEED0F567E563F9EB0EC82B8FFA550D062605A7369EA00E78899E02075D2EFDC7319C71AA0574C3661A4E3F9D606FB731AD1EB8CEC6A41ACDB135692B9CFFA415BBE884E307B3D6F2DEFAC53F3F7B80B5B3671503D83FE22C4A41BDA967F83AF60E158E68B601CEC53CB760E256; expires=Fri, 09-Aug-2013 14:53:18 GMT; path=/; HttpOnly X-AspNet-Version:4.0.30319 X-AspNetMvc-Version:4.0 X-Powered-By:ASP.NET

For the form with the upload fields that times out:

Request URL:http://opentraits.com/bogdan-litescu/communities/new Request Headersview source Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryUq7yyIv4EnP2hJTA Origin:http://opentraits.com Referer:http://opentraits.com/bogdan-litescu/communities/new User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17 Request Payload ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="Id"

0 ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="Name"

wefewfwefw ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="Icon"; filename="" Content-Type: application/octet-stream

------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="Logo"; filename="" Content-Type: application/octet-stream

------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="Website"

------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="About"

------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IterationEnabled"

false ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IterationNextStart"

2013-01-28 ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IterationLength"

2 ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IterationPause"

0 ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IterationTotalPoints"

10 ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IterationPointScale"

0,1,2,3 ------WebKitFormBoundaryUq7yyIv4EnP2hJTA Content-Disposition: form-data; name="IncentivesEnabled"

false ------WebKitFormBoundaryUq7yyIv4EnP2hJTA--

So just by placing the upload fields on the form many request headers are no longer sent on post. I've run out of debugging ideas. Is it related to Asp.Net MVC, Azure, internet providers? Why would some headers not be sent with the request in some locations only?

Any help to figure this out is greatly appreciated!

Update

I've isolated the form in a plain html file at at http://opentraits.com/test.html The backend is just a redirect back to test.html. If I try from my location I see how some request headers are not passed along and the request times out. If I try with remote desktop from other locations, it works fine - the headers are all there and it redirects back to test.html.

Update2 The backend is a Asp.NET MVC model.

public class CommunityModel
{
    public int Id { get; set; }

    [Required]
    [StringLength(255, ErrorMessage = "The {0} must be less than {1} characters long.")]
    public string Name { get; set; }

    [StringLength(255, ErrorMessage = "The {0} must be less than {1} characters long.")]
    public string Website { get; set; }

    [StringLength(1000, ErrorMessage = "The {0} must be less than {1} characters long.")]
    public string About { get; set; }

    public HttpPostedFileBase Icon { get; set; }

    public HttpPostedFileBase Logo { get; set; }

    ....................
}

And then handled in the controller with a simple redirect:

[HttpPost]
public ActionResult New2(string entityId, CommunityModel communityModel)
{
    return new RedirectResult("/test.html");
}
1
I also have an ajax multi file uploader in a different form and it also gives timeouts. It's probably something related to some ISPs and Azure working together but I can't figure out what.Bogdan Litescu
Are you using Application Request Routing?Alex Filipovici
This is an Azure App. I haven't added anything above that to optimize for scalability.Bogdan Litescu
Have you tried leaving only one upload field on the form?Alex Filipovici

1 Answers

0
votes

Try setting the

context.Response.BufferOutput = false; 

and also don't set the content length.