Hi,
I am getting an error "Server responded with 0 code" when attempting to upload large files (threshold so far is >50MB but not sure what the minimum is).
I am using dropzone.js in an ASP.NET MVC4 app, I have configured the web.config with the appropriate settings to allow for increased file size and longer timout, e.g.:
<system.web>
<httpRuntime targetFramework="4.5" maxRequestLength="512000" executionTimeout="3600" />
</system.web>
..
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="524288000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>
I have also configured dropzone options like this:
{
autoProcessQueue: false,
uploadMultiple: false,
maxFiles: 10,
paramName: "file",
addRemoveLinks: true,
maxFilesize: 500,
previewsContainer: 'div.dropzone-previews',
For smaller files it works great, but for some reason on larger files of any type, it returns an error, but doesn't have any information about the error. Using IE I can see that the console throws this error when it fails
XMLHttpRequest: Network Error 0x2eff, Could not complete the operation due to error 00002eff
Any help you can provide on the error is much appreciated.
Ok so I have been able to isolate the issue.
Basically I am using an edge server with IIS 7.5 and Application Request Routing (ARR) to route incoming web connections to other web servers based on incoming hostname.
If instead I route all incoming web traffic directly to my development web server (via router port mapping) then I dont get the error and the upload completes successfully.
I have tried increasing the ARR > Server Proxy Setting > Timeout value, but that doesn't make any difference.
Any suggestions?
Could this be a browser issue? I'm seeing the same error but only in iOS 8 Safari. Chrome on iOS 8 works fine.
I don't think that is the problem I am experiencing (I haven't even tested in iOS yet). Basically I found that if I extend the Connection Time out for the website on the proxy server (either the default website or if I set up a new website that will use Url Rewriting to forward on to the internal server) by going to Website > Manage Website > Advanced Settings > Connection Limits > Connection Time-out, then the error takes exactly the new time out period before it is thrown.
So for me the error is caused by the proxy serving giving up on the connection during the long running upload.
I attempted to keep the time out from firing by turning off the session for the page I am working on and firing off async calls back to the server to keep it alive, and whilst this polling was working, it didn't have the desired effect of keeping the time-out from expiring.
Anyone know how I can keep the proxy connection alive?
I'm on PHP/Nginx/Laravel and my users are occasionally reporting "Server responded with 0 code". They can never reproduce it, though. I just confirmed that it's the iOS 8 Safari bug.
Getting same error
Its on linux server (godaddy)
Tried to figureout the problem but no luck
Got it fixed my bad when moving from local to server forget to change the upload url which was pointing to local server.
@ajitbohra : can you explain how you achieved this problem resolved by giving any short example. It will help us because currently i am facing same issue of server 0 error
@harshal-shinde in my case it was due to invalid upload path. If you can share the code can help you better
This can also happen when attempting to upload to Amazon S3 and you don't have the appropriate CORS configuration setup.
I have everything in place, working fine for small total file size. But I need to upload 1 GB total files, comprising of 50/20 diff. files in total. So filesize could be at least 50 MB.
Server responded with 0 code for all of them. Some files are uploaded in nginx folder but others failed and so the further processing by unicorn is also not started.Please suggest
+1
Same issue.
"Server responded with 0 code." First files where uploaded successfully, then after a certain time this error is thrown.
IIS 8 system
Hate to bump this really old issue, but I am getting this problem now and can't figure it out. Trying to upload large files via dropzone into azure blobs.
Did anyone ever find the resolution? I'm running on an azure web app and I have the relevant maxAllowedContentLength setting made in web.config and MultipartBodyLengthLimit set in Startup.cs.
I can upload large files no problem when running on my own machine (even uploading to production blob storage), but it doesn't work on the production web app on azure. ;(
I found the reason. It was no problem of dropzone. In my case there were 2 reasons, both on IIS settings, maybe similiar to Apache or other webservers.
1) I saw that the connection always broke down after 2 minutes of uploading. I had to increase the connection timeout (in IIS go to your website (i.e. Default Website) -> Advanced Settings -> Connection Timeout)
2) Increase maxAllowedContentLength value
Maybe someone helps this, too.
@dnsnx Your comment certainly helped me! Thanks!
This happens constantly on FileFactory.com site. they must be using this system, i wish they used something else to upload. It's pretty terrible. And they don't acknowledge the problem.
I have the same issue. and backend set
spring.http.multipart.max-file-size=1024MB
spring.http.multipart.maxRequestSize=1024MB
When I upload files smaller than 0.5GB, there is no problem, but when it is larger than 0.5GB,
It will return error: 'Server responded with 0 code'.
Is there any solution about this?
Instead of large files, I'm uploading a bunch of small to medium sized files. Like around 150 1mb-5mb files. This runs completely fine on my localhost / XAMP but when I try and upload the same files on my site hosted on Godaddy, I get this error after about 1 minute.
I've tried changing the php.ini to:
post_max_size = 50M
upload_max_filesize = 50M
max_execution_time = 600
max_input_time = 600
max_file_uploads = 100
default_socket_timeout = 600
But none of that is having any effect, I still get the error.
@diamond-skull Check with your host if they are blocking anything. When I hit this issue (earlier in the thread) it turned out the problem was Cloudflare blocking files over a certain size due to their pricing structure.
I think this issue can occur if you temporarily lose internet while in the middle of an upload, which is more likely with a mobile device if you have a spotty connection.
I can also get this happen with my iphone if I choose to upload a 2nd file as an existing one is about to complete and receive a response back. While XHR returns a status value of 0 with the 1st request, it actually completes it's request with my server logs showing a 200 successful response back to the request. I cannot seem to reproduce the same behavior with a computer so I don't know if it's a mobile quirk when dealing with ajax.
More Edits:
I think my problem might be caused by a bug with IOS. It seems like having the camera or file library interface open while an existing file is being uploaded causes IOS to prematurely close the connection, preventing a response from ever reaching the client (and thus, causing dropzonejs to also give back the server responded with 0 message)
There are many issues with the upload, in a few minutes of testing I've noticed the following behavior:
https://foo.com/bar instead of https://foo.com/bar/ (notice the trailing slash), server returns 301 and dropzone returns error code 0 instead of resolving the redirection. (Also, instead of return code 301, it returns code 0 weirdly, which makes me believes the original http status is swallowed somewhere. Not great behavior for debugging).OPTIONS http request to the server. I can see the server returning "OPTIONS /project/ HTTP/1.1" 200 10184 (return code 200) but dropzone still returns error code 0. So I guess this code is not usable at all anymore :(

version: 2.3.4
Another thing to look out for is if you use Apache 2.4, I believe it comes with the mod_reqtimeout module loaded. The defaults can cause connections to be killed (20 seconds to receive request body, which may be exceeded during a slow/large upload).
Another thing to look out for is if you use Apache 2.4, I believe it comes with the mod_reqtimeout module loaded. The defaults can cause connections to be killed (20 seconds to receive request body, which may be exceeded during a slow/large upload).
i am use nginx 1.15 x64 on windows server 2016
Hi,
Same issue with Debian 9 Stretch, Apache 7.2.17 Application FPM on PLESK
Error after 2 secs of upload....

Thanks for your help !
Same here...
i have move to filemanger
Most helpful comment
This can also happen when attempting to upload to Amazon S3 and you don't have the appropriate CORS configuration setup.