Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to upload a file into FTP server(GoDaddy Server)...
I used the following code...


VB
Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
    Try
        Dim filePath As String = "~/"
        Dim fileName As String = fileUpload.FileName.ToString()
        fileUpload.SaveAs(Server.MapPath(filePath) & fileName)
        ErrorMessage.Text = "Uploaded Successfully :)"
    Catch ex As Exception
        ErrorMessage.Text = ex.Message.ToString()
    End Try



I got the error like..
Access to the path 'D:\Hosting\8064208\html\csv.jpg' is denied.

Here in my local system i didn't have like such path as mentioned in the above line...It showing as default

I cannot able to solve this issue

Could any one please..
Posted
Comments
Van Hua 8-Aug-11 0:37am    
Maybe It throws that error because your "filePath"????

1 solution

Your ASP.Net user (the one you are hosting your web page with), does not have access to the image you are trying to access.
 
Share this answer
 
Comments
msk kumar 5-Aug-11 7:56am    
Hi Abhinav,

Thanks for your reply...
i have changed the write permission with GoDaddy server for the particular folder where i want to upload my files...

My question is the above code is working fine when we run in localhost...
but in case when we run in website it throws this error...

so i hope you understand what i am saying...
so could you give some suggestions...

Thanks in Advance

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