Asp.net fileupload Vanishes on postback without AJAX

ajaxasp.netfile upload

I m using asp.net 2.0 without AJAX.
The file path in the fileupload control gets vanished once the postback take places. i do some validations for other controls in code behind.
i need to upload the file again for further processing. can any one suggest me how to hold the filepath in the fileupload control even after postback.

Best Answer

I agree with Silky. FileInput control cannot hold value across post backs.

A possible workaround for this can be how GMail handles uploading attachments. The file can be placed in some temporary location on server and after the post back, display a label indicating that the file is already selected and provide a remove button. A problem here is that you have to consider cleaning up such files.