简体   繁体   中英

Possible to keep file path across post backs with the FileUpload control?

I have a situation where I want a user to select a file, then select an option from a DropDownList.

When they select an item from the DropDownList I do an auto post back and do some stuff with the file, but this causes the path to clear out. Is there some way that I can keep the path from clearing out?

AFAIK it is impossible for security reason. There is no way to modify contents of file uploader by javascript or something like that. Only thing I can suggest is having a label on page which will show the file path from the last postback.

You can save the path in the input hidden, and every postback or change the value on .fileupload you can update the some input. It's just a possibility. Best Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM