Monday, July 20, 2009

Access denied to folder when using FileUpload dialog

I had this problem when i was creating a video management system.

Problem: Access denied to a folder that you are trying upload a file to, using FileUpload.

Solution:
FileUpload has a posted file. When a postback occurs the posted file stream is removed. I had a button called [Upload Video] that was meant to validate the upload. The actual upload operation is done after all the information is input and the [Save] button is hit. So because of this problem i decided to make the [Upload Video] do the upload operation.

Put simply: You need to perform the saving of the file prior to any postback, otherwise the file stream is not there anymore!

No comments:

Post a Comment

There was an error in this gadget