Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
May 03, 2012 10:33 AM|LINK
I am using System.IO to upload multiple files. I am still trying to get the code working
but having no luck.
On my File Server I have a Directory Called "Users".
On my aspx page, I have a FORM that gets info from a new user.
I now want to save the images in the "Users" Directory and within that create
another Directory Called The "Name" of the user - taken from the "Name" Textbox
on the form.
string name= Name.Text; // (variable from form)
HttpFileCollection uploadedFiles = Request.Files;
for (int i = 0; i < uploadedFiles.Count; i++)
HttpPostedFile file = uploadedFiles[i];
string fileExt = Path.GetExtension(file.FileName).ToLower();
string fileName = Path.GetFileName(file.FileName);
if (fileName != string.Empty)
catch (Exception ex)