Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my project i have created a folder for storing images when anyone uploads the images.it works fine.but problem is that when i upload the same thing in ftp ,it is displaying an error like "the given path's format is not supported".How can i get through from that.



Thank you,
Posted
Comments
Prerak Patel 15-Mar-11 5:25am    
It is very common and easy to solve by debugging. Share some code to get appropriate answer.
lakshmanriz 15-Mar-11 5:31am    
here is the some code


WebRequest rqstOne = WebRequest.Create("ftp://xxxxxx.com/SampleImages/" + Session["WorkingImage3"] + "");
rqstOne.Method = WebRequestMethods.Ftp.UploadFile;
rqstOne.Credentials = new NetworkCredential("xxxxx", "******");
using (var resp = (FtpWebResponse)rqstOne.GetResponse()) ;
FileSaved = true;

1 solution

You'll have to use the class FtpWebRequest[^] as WebRequest does not allow for the schema ftp: http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^].
That will resolve your issues.

Regards,
 
Share this answer
 
v3
Comments
Espen Harlinn 17-Mar-11 10:11am    
5ed!

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