Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear Friends,

i want browes file and save on the server in an folder. i am using this code plz guide me its urgent.

if (FileUploader.HasFile)
           try
           {
               FileUploader.SaveAs(Server.MapPath("confirm//") +
                    FileUploader.FileName);
               Label1.Text = "File name: " +
                    FileUploader.PostedFile.FileName + "<br>" +
                    FileUploader.PostedFile.ContentLength + " kb<br>" +
                    "<br>Uploaded Successfully";
           }
           catch (Exception ex)
           {
               Label1.Text = "ERROR: " + ex.Message.ToString();
               Label1.Visible = true;
           }
       else
       {
           Label1.Text = "You have not specified a file.";
           Label1.Visible = true;
       }</br></br></br>



Regards
Deepak
Posted
Comments
Syed Salman Raza Zaidi 29-Jul-11 3:16am    
Whats the problem arising?
guptaadeepak 29-Jul-11 3:24am    
i am not able to save file on server my folder confirm is still empty what will i do??

hello friend give me update plz
 
Share this answer
 
Comments
lovejeet0707 29-Jul-11 3:53am    
I have the Same Question......
Please Reply to me as soon as it is solved
guptaadeepak 29-Jul-11 7:24am    
hello lovejeet provide the permission of that folder go security and then IIS and apply and ok and your file will be save on server ok
The code seems to be correct. Do you face any problem using this code?
 
Share this answer
 
Comments
guptaadeepak 29-Jul-11 3:24am    
i am not able to save file on server my folder confirm is still empty what will i do??

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