By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,911 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,911 IT Pros & Developers. It's quick & easy.

PostedFile.SaveAs not correctly saving a file

P: n/a
I have a web usercontrol on which is a Webcontrols.FileUpload control.
I expose the PostedFile property as a readonly property of the
usercontrol. That way, a page has access to it.

However, when my page does this mycontrol.PostedFile.SaveAs(filename),
the file is not getting saved correctly. For instance, uploading a jpg
or movie file results in a file being saved with the correct name, but
the file size is only 112 bytes or so. It's like it's saving some
header information, but not the actual file. When I check the
ContentLength of the PostedFile before running SaveAs, it's only 112
bytes...even though the file was originally 23kb. What's going on?

Is there a reason this is happening? Is there some weirdness because
the PosteFile property is exposed by the usercontrol and used by the

May 9 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Figured it out. I was using a third party upload httpmodule at one
time and it was still registered in the web.config and hijacking my
uploads. Removed the web.config stuff and works fine now.

May 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.