HttpPostedFile.SaveAs

So I'm building a simple app that allows users to upload photos to our public website.  I'm using the FileUpload control that is built into ASP.NET.  It has worked like a charm before in other apps, but today I started having a problem with it, in place of the files that get uploaded are a little text file (with the same name specified in the HttpPostedFile.SaveAs method) with these contents: 

The original file is in the temp folder. Full path of the file: C:\Temp\597fb3e5-542d-48ba-9b61-08bf9f6ddc42.tmp

So I go checkout the Temp folder and sure enough, albeit renamed, my .JPG's are there.  After googling, I found a post on the ASP.NET forums, but alas no answers.  Absolutely nothing else.

I've tried using IIS on Vista, Visual Studio Development Server, and even pushed it to a staging server, they all produce the same behavior. I have given the ASP.NET process Modify access rights to the folder, but I think if it was a security issue it would throw an "Access Denied" exception. I'm going to revisit some old apps where I have used this control and see if I can spot anything that stands out.

UPDATE: I figured it out, the culprit was a 3rd party component installed previously.

Published Thursday, May 24, 2007 9:45 AM by mxmissile
Filed under: ,

Comments

# re: HttpPostedFile.SaveAs

Thursday, May 24, 2007 12:43 PM by Raj

One of my colleagues Vignesh , actually blogged about this.

You can find about this here .

How to change the default TempFile upload location for the ASP.NET 2.0 FileUpload control?

blogs.msdn.com/.../how-to-change-the-default-tempfile-upload-location-for-the-asp-net-2-0-fileupload-control.aspx

# re: HttpPostedFile.SaveAs

Friday, February 29, 2008 4:14 PM by Tim

I'm having the same problem, but I don't think I've installed any third party software.  What was it exactly that was causing your issue?

Thanks.

# re: HttpPostedFile.SaveAs

Monday, March 31, 2008 12:17 PM by mxmissile

Tim, it was a third party component left over from legacy ASP days.

# re: HttpPostedFile.SaveAs

Thursday, October 16, 2008 7:31 PM by Ivangc

Do you remember what 3rd party app was that? I'm experiencing that problem right now... :S

Leave a Comment

(required) 
(required) 
(optional)
(required)