.NET: Possible to upload multiple files to MULTIPLE target folders? -
i realize file upload control in .net 4.5 can upload multiple files @ once single folder possible upload parse them separate folders? example, if hundreds of files named different names, can automatically uploaded same named folders. realize need folders created on fly well.
if possible how it? in advance. did try searching quite time haven't found close yet.
yeah, should work. upload control has postedfiles property contains ilist<httppostedfile>. httppostedfile object has it's own saveas method, see here: http://msdn.microsoft.com/en-us/library/system.web.httppostedfile.saveas(v=vs.110).aspx
so, (counter illustration):
int = 0; foreach(httppostedfile file in upload1.postedfiles) { i++; file.saveas("c:\\temp\\" + + "\\" + file.filename); }
Comments
Post a Comment