Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 22, 2013 08:27 AM by Md Saleh
Member
152 Points
73 Posts
Nov 26, 2008 01:11 PM|LINK
Hello all,
I have a list of files in a text file, let say listfiles.txt
inside the file, I have the path of all files that I would like to upload into the server.
example:
c:\file1.jpg
c:\file2.jpg
c:\file3.jpg
.......
c:\fileN.jpg
Is there a way that I can upload these files at the sametime?
Thanks
204 Points
32 Posts
Nov 26, 2008 06:09 PM|LINK
Hi buddy,
Hope these articles will help you to do this. use thie methods described in these articles
http://www.codeproject.com/KB/aspnet/multiuploads.aspx
http://www.dotnetjunkies.ddj.com/Tutorial/81E0C3A9-1B40-425C-B150-B578FE724A39.dcik
Bye
Dec 01, 2008 05:38 PM|LINK
Thanks for your reply.
Both of these, we have to add each file.
I am looking for a solution to upload all files inside a folder at one click.
2 Points
1 Post
Feb 22, 2013 08:27 AM|LINK
here is the easiest way...in the world...after lots of frustration..finally upload with using any plug-in... Filename.aspx.cs protected void btnupload_Click(object sender, EventArgs e) { string tempPath = System.Configuration.ConfigurationManager.AppSettings["FolderPath"]; string savepath = Server.MapPath(tempPath); for(int i=0;i<Request.Files.Count;i++) { HttpPostedFile hpf = Request.Files[i]; string filename = hpf.FileName; hpf.SaveAs(savepath + @"\" + filename); } } Filename.aspx <div> <input type="file" id="FileUpload1" multiple="multiple" runat="server"/> <asp:Button runat="server" ID="btnupload" Text="Upload" onclick="btnupload_Click"/> <br/> <asp:Label runat="server" ID="Label1"></asp:Label> </div> Web.config <appSettings> <add key ="FolderPath" value ="uploads"/> </appSettings >
vinhwsu
Member
152 Points
73 Posts
upload multiple files c#
Nov 26, 2008 01:11 PM|LINK
Hello all,
I have a list of files in a text file, let say listfiles.txt
inside the file, I have the path of all files that I would like to upload into the server.
example:
c:\file1.jpg
c:\file2.jpg
c:\file3.jpg
.......
c:\fileN.jpg
Is there a way that I can upload these files at the sametime?
Thanks
prasannavign...
Member
204 Points
32 Posts
Re: upload multiple files c#
Nov 26, 2008 06:09 PM|LINK
Hi buddy,
Hope these articles will help you to do this. use thie methods described in these articles
http://www.codeproject.com/KB/aspnet/multiuploads.aspx
http://www.dotnetjunkies.ddj.com/Tutorial/81E0C3A9-1B40-425C-B150-B578FE724A39.dcik
Bye
MCPD | Web Developer
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
vinhwsu
Member
152 Points
73 Posts
Re: upload multiple files c#
Dec 01, 2008 05:38 PM|LINK
Thanks for your reply.
Both of these, we have to add each file.
I am looking for a solution to upload all files inside a folder at one click.
Thanks
Md Saleh
Member
2 Points
1 Post
Re: upload multiple files c#
Feb 22, 2013 08:27 AM|LINK
here is the easiest way...in the world...after lots of frustration..finally
upload with using any plug-in...
Filename.aspx.cs
protected void btnupload_Click(object sender, EventArgs e)
{
string tempPath = System.Configuration.ConfigurationManager.AppSettings["FolderPath"];
string savepath = Server.MapPath(tempPath);
for(int i=0;i<Request.Files.Count;i++)
{
HttpPostedFile hpf = Request.Files[i];
string filename = hpf.FileName;
hpf.SaveAs(savepath + @"\" + filename);
}
}
Filename.aspx
<div>
<input type="file" id="FileUpload1" multiple="multiple" runat="server"/>
<asp:Button runat="server" ID="btnupload" Text="Upload"
onclick="btnupload_Click"/> <br/>
<asp:Label runat="server" ID="Label1"></asp:Label>
</div>
Web.config
<appSettings>
<add key ="FolderPath" value ="uploads"/>
</appSettings >