Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
protected void UploadButton_Click(object sender, EventArgs e)

{

if (FileUploadControl.HasFile)
{
try
{
string filename = Path.GetFileName(FileUploadControl.FileName);

FileUploadControl.SaveAs(Server.MapPath("~/images/") + filename.ToString());

StatusLabel.Text = "Upload status: File uploaded!";
}
catch (Exception ex)
{
StatusLabel.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}


}
Posted
Updated 28-Mar-15 5:18am
v2
Comments
Member 8893861 1-Apr-15 4:56am    
Resolved
folder on remote server had no write permission
thank you

You've probably got write permissions disabled in the file system for the folder: check it via FTP and you should be able to change it remotely.
 
Share this answer
 
Comments
Member 8893861 28-Mar-15 12:09pm    
i allowed permission to folder , but it is showing same error.
Member 8893861 29-Mar-15 10:29am    
could you please tell me how to unable it ?
Member 8893861 1-Apr-15 4:55am    
Resolved
folder on remote server had no write permission
thank you
OriginalGriff 1-Apr-15 5:50am    
You're welcome!
HI,

which folder you are going to import file in that folder you can give full permission of local user as well as administrators also.
if the folder is in subfolder then provide permission to main folder.

I hope it will be helpful for you.

Thanks
 
Share this answer
 
Comments
Member 8893861 30-Mar-15 14:19pm    
i tried both
my os is win08
my exact error is
Access to the path 'D:\INETPUB\VHOSTS\libacp.com\httpdocs\images\1234.jpg' is denied.
I dont know what to do , i tried many things .
Member 8893861 1-Apr-15 4:56am    
Resolved
folder on remote server had no write permission
thank you

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