Link to home
Start Free TrialLog in
Avatar of venture-it
venture-it

asked on

HttpPostFile.SaveAs is saving empty file in IIS

I upload multiple files via an ASP page and save them as HttpPostFiles in a datatable while the user enters data in a form. When the user clicks Save, I write the data to SQL tables and save the HttpPostFiles to a server folder.

This works fine in debug mode in Visual Studio 2010, but not in IIS 7 on my local PC. It does work with only one file in IIS.

The symptom when it fails is that the files get saved to the server folder with 0 bytes, and the code does not save the database record. I suspect it fails, but Console.Write does not record anything in the IIS log file.

Its funny that it works with one file, but when it fails with with multiple files, even the first file in the datatable does not get saved properly.
RequestEdit.aspx.cs
Export-Doc.cs
RequestEdit.aspx
ASKER CERTIFIED SOLUTION
Avatar of Craig Wagner
Craig Wagner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of venture-it
venture-it

ASKER

Thanks, I got the Debug.Write to work with the debug viewer. I will accept this as solution so you get the points,  and will repost when I have more analysis.