Author: Son Volt | Posted on: 10/8/2008 8:25:24 AM | Views : 368

I'm trying to create a way for the user to add attachments to an ASP.NET form without knowing how many attachments the user will add before submission. I'm trying to mimic the way SharePoint achieves this by - 

1. the user browses to a file with a browse button

2.  user presses the add button

3.  a label below the browse button shows the path to the file without immediately uploading the file. (C:\MyDocuments\ExpenseReport.xls etc)

The user can continue these steps to select mulitple number of attachments. Once the form is submitted the files are uploaded along with the form submission. I think I can achieve this with a little javascript but I'm not sure how to turn the a file path into a FileUpload control so I can access the FileUpload.PostedFile property to get ahold of the file. Do I even need to turn these paths into FileUpload controls or is there a better way of doing this?
...

Go to the complete details ...