Click here to Skip to main content
15,897,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Could someone help me writing the code that allows me to attach or upload more than one file to a listbox in my website? After the user finishes adding to the listbox, the code for uploading the files should be executed, to upload the attached files that are in the listbox.
Posted
Updated 2-Feb-11 23:02pm
v2

1 solution

Let me first clarify about my understanding of your scenario with you.

You need to upload multiple files at a time. You need name of the files in a ListBox control on the page. And finally user can click save and files should be uploaded to the server.
If this is what you need, read further.

ASP.NET has FileUpload Control[^] for uploading files to the web server. You will need to place multiple controls for multiple upload at a time. The above link discusses how to do it. For more examples here is the Google search link - uploading multiple files asp.net[^]

Now about getting the file name in ListBox part -

Add an onblur event to all the FileUpload control and call a JavaScript function which gets the name of the file and add it to the ListBox. Again a lot of examples are available on the web. Try! :thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900