D
daokfella
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
page?
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
page?