SOLVED - Need Help With Mysterious IO Error

First off, I would like to thank the creator(s) for their hard work in creating this utility. I think this is exactly what I need once I get it working correctly.

I run a website that needs to allow users to upload files up to 400MB in size. It is an ASP.Net application running on the .Net 3.5 framework (so .Net 2.0 utilities like this one work just fine). We have a shared hosting plan on GoDaddy.

I downloaded the demo found at this location http://swfupload.org/node/47 and re-worked it a bit to allow .pdf and .eps file types only (the type we are going to be allowing users to upload). If you want to take a look at all the code I have so far, you can view it in my Subversion repository at svn://iis.sozo.ca/Projects/Testing/SWFUpload (The Original directory is the project that works with jpg uploads; the Changed directory is the project that I'm working with to allow large PDF and EPS files).

I seems like any file size works when I run the project locally; however, when I run the project in the production environment on the live server, uploads over 37MB fail.

Below is the debug info:


----- DEBUG OUTPUT ----
ID: SWFUpload_0
control_id: SWFUpload_0
ui_function: null
ui_container_id: swfu_container
degraded_container_id: degraded_container
upload_target_url: upload.aspx
upload_cookies:
upload_params: [object Object]
begin_upload_on_queue: true
file_types: *.pdf;*.eps
file_types_description: Common Vector Image Formats
file_size_limit: 409600
file_upload_limit: 0
file_queue_limit: 0
flash_url: swfupload.swf
flash_container_id: theflashgohere
flash_width: 1px
flash_height: 1px
flash_color: #FFFFFF
debug_enabled: true
----- DEBUG OUTPUT END ----

SWF DEBUG: SWFUpload Init Complete
SWF DEBUG:
SWF DEBUG: ----- SWF DEBUG OUTPUT ----
SWF DEBUG: ControlID: SWFUpload_0
SWF DEBUG: Upload Target URL: upload.aspx
SWF DEBUG: Upload Query String:
SWF DEBUG: Begin Upload on Queue: true
SWF DEBUG: File Types: *.pdf;*.eps
SWF DEBUG: File Types Description: Common Vector Image Formats (*.pdf;*.eps)
SWF DEBUG: File Size Limit: 409600
SWF DEBUG: File Upload Limit: 0
SWF DEBUG: File Queue Limit: 0
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
SWF DEBUG:
Flash called back and is ready.
SWF DEBUG: UploadFile: Browsing files. *.pdf;*.eps
SWF DEBUG: Files Selected. Processing file list
SWF DEBUG: onSelect: File within size limit. Adding to queue and making callback.
SWF DEBUG: onSelect: Uploads set to begin immediately. Calling StartUpload.
SWF DEBUG: StartUpload(): Starting Upload. File ID: undefined
SWF DEBUG: StartFile: File ID undefined
SWF DEBUG: startFile(): File Reference found. Starting upload to upload.aspx?file_id=SWFUpload_0_0. File ID: SWFUpload_0_0
SWF DEBUG: startFile(): Upload started.
SWF DEBUG: onProgress: File ID: SWFUpload_0_0. Bytes: 32768. Total: 93642606
SWF DEBUG: onProgress: File ID: SWFUpload_0_0. Bytes: 98304. Total: 93642606
SWF DEBUG: onProgress: File ID: SWFUpload_0_0. Bytes: 131072. Total: 93642606
......
SWF DEBUG: onProgress: File ID: SWFUpload_0_0. Bytes: 38600704. Total: 93642606
SWF DEBUG: onProgress: File ID: SWFUpload_0_0. Bytes: 38633472. Total: 93642606
SWF DEBUG: onProgress: File ID: SWFUpload_0_0. Bytes: 38666240. Total: 93642606
SWF DEBUG: onIOError: File ID: SWFUpload_0_0. IO Error.
SWF DEBUG: UploadComplete(): Upload complete. Removing File Reference and starting the next upload.
SWF DEBUG: StartFile: File ID undefined
SWF DEBUG: startFile(): No File Reference found. All uploads must be complete, cancelled, or errored out.
SWF DEBUG: startFile(): Ending upload run. Completed Uploads: 0

The problem that I am having is similar to the problem here: http://swfupload.org/forum/generaldiscussion/335
But I'm pretty sure that the solution that was suggested will not help me. In this particular test, the upload hung at 38666240 bytes, but each test I do hangs at a different number, but they are in the range of 37000000 to 39000000 bytes. It appears it's not a timeout issue either because each test hangs at different times (between 275 seconds to 315 seconds).

If you are able to look at my source files in the subversion repository, you'll see that the web.config settings are ok:


httpRuntime maxRequestLength="409600" executionTimeout="3600"

If you want to test my live version, go to http://www.bannersio.com/testing

Thanks in advance for your help. If there's anymore information you need from me to help solve my issue, please let me know right away. I'm getting desperate and need a working upload utility as soon as I possibly can.

Brandon

gyphie's picture

Diagnosis...

I tested your Live site and once got a 404 error and once got an IO error (which is Flashes way of saying, something didn't work but I don't know what it was).

If you can I'd check your server logs to see if you are getting 404s and verify that you have a valid value in your upload_url setting. Try using an absolute path: "/test/upload.aspx"

Secondly, I'd install WireShark and capture an upload and examine what the server is returning since Flash won't give you this information. More often than not you'll find out exactly what ASP.Net is doing and the fix is pretty easy.

WireShark Question

Thank you for your reply!

I am not at all familiar with WireShark, but I've installed it on my machine and have started to read the documentation and play around with it.

When you say "capture an upload" do you mean that I should have WireShark capturing on my local machine or does it need to be capturing on the server?

I'm hoping you mean I should capture on my local machine as I run the upload because installing and running WireShark on the server isn't an option (GoDaddy shared hosting).

Thanks again for your help,
Brandon

gyphie's picture

Wireshark

Wireshark should be installed on your local machine.

0. Load your SWFUpload web page
1. Open Wireshark...Click the first toolbar icon.
2. Find your Network Interface (there may be several, some are virtual, one represents your network connection).
3. Click "Options" for that interface
4. Click "Capture Filter"
5. Select "HTTP TCP port (80)" from the list and click "OK" (depending on your version of Wireshark this filter might be too strict and you'll have to tweak it a bit)
6. Click "Start"
7. Return to the browser, select a file and upload it.
8. After the upload is finished return to WireShark
9. Click the "Stop button" or the Stop Toolbar icon (4th).
10. Find a packet in the results list that says "POST..." in the INFO column and right click it.
11. Click "Follow TCP Stream"
12. Examine the window to see what Flash sent to the server and what the server responsed with (they should be red and green)

Thank You

Excellent, thank you! Ill give that a try and report back.

Results - Still No Solution

Once again, thank you very much for your detailed instructions. It helped me to understand how to use the program a lot quicker than I was learning by reading through the documentation.

I did have to tweak the filter in order for the POST packet show up. Once I got it, I did what you instructed "Right-click and follow the TCP stream". When I did that, I only saw info going to the server, nothing coming back. So I ran the same capture on the smaller file which I can upload successfully. When I follow the TCP stream on that post, I do see a response back from the server at the bottom of the window.

I saved both captures and uploaded them to the server so you can download and have a peak... if you wish. You can get them at http://www.bannersio.com/testing/captures/

Maybe I did something wrong, but I'm pretty sure I followed your steps correctly. Maybe I'm missing something in the TCP stream window, but I don't think so.

Any other ideas?

Thanks again for your help! I REALLY do appreciate it!

gyphie's picture

Small and Large

When a small file works but a large file does not it is usually a server configuration issue.

Either a maximum file size limit or a maximum post size limit. You might run phpinfo() and check these settings on your server.

I DISCOVERED THE SOLUTION!!!

Well, it appears I've found the solution. The website is being hosted on IIS 7. Additional settings are required in the web.config file for IIS 7 hosting. Along with the maxRequestLength and executionTimeout attributes of the httpRuntime element in the system.web section, I also had to add requestFiltering settings in the system.webServer section. Below is an example (settings are for a max file size of 400MB; maxRequestLength is in KB, maxAllowedContentLength is in Bytes):


<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true"/>
<authentication mode="None"/>
<httpRuntime maxRequestLength="409600" executionTimeout="3600" />
<customErrors mode="Off" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="419430400" />
</requestFiltering>
</security>
</system.webServer>
<location path="upload.aspx">
<system.web>
<httpRuntime maxRequestLength="409600" executionTimeout="3600" />
</system.web>
</location>
</configuration>

Apparently requestFiltering cannot be overridden unless it is allowed in the machine.config file on the server. Lucky for me, GoDaddy's shared hosting allows overriding the requestFiltering. If anyone else is trying to do this and is getting an error that the requestFiltering cannot be overridden, then you must edit machine.config file and change

<section name="requestFiltering" overrideModeDefault="Deny" />

to

<section name="requestFiltering" overrideModeDefault="Allow" />

All of my uploads worked perfectly after adding these settings to the web.config. I successfully uploaded a 90MB file twice and a 350MB file once. Just to make sure it was not a fluke, I reverted back to the old web.config settings, and sure enough, everything failed again.

Gyphie, thanks again for all your help. I'm glad it was something nice and easy... it usually is, isn't it!