Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to make a multiupload code.

with two button :

add : to add the file from fileupload to a list.
upload : to upload all the file from the list.

in the list i am saving :
Vale = the file name.
FullPath = full path from the client side.

and i want to upload them from the FullPath in the list to some file :

C#
String _dest = "~/upload/";
foreach (FileListType _temp in FileList )
{
     FileUpload _file = new FileUpload();


}

protected List<FileListType> FileList { set; get; }
protected struct FileListType
    {
        public String Value { set; get; }
        public String FullPath { set; get; }
    }



but actually i don't know how to continue :
my idea is to build a new fileupload and give them the path from the list for each element and upload it using that fileuploader

but how can I add my file path to the fileuploader ?
any one can help me or lead me where i can search ?
Posted
Comments
Gideon van Dyk 1-Mar-15 22:34pm    
FileUpload is a WebControl, and must exist on the page when the user "submits" the page to "upload" the files. Unfortunately this means you will need to know how many uploads you will be supporting before submission. On submission you can check the hasFile property and then the SaveAs command to save the file server side.
ENG.Samy Sammour 1-Mar-15 23:59pm    
but actually my idea is to make one fileupload and a div containing the files each time I click add the file added to the div in repeater and the list increasing by one

but the problem is in the upload logic
ENG.Samy Sammour 2-Mar-15 0:01am    
ok maybe i can figure out something in the repeater i am flexible with the element inside so i can add fileupload with visible="false" but how to set the current file to that repeater ?

1 solution

The path on the client side will not be sent to the server - Get Full Path from FileUpload control in ASP.Net[^].
Just the file will be transferred.
 
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