i have files stored at azure blob. Now i want to transfer file directly form blob to ftp server.
i have tried this.
string ftpfullpath = @"ftp://myftp.com/Test.xml";
FtpWebRequest ftp = WebRequest.Create(ftpfullpath) as FtpWebRequest;
if (ftp != null)
{
ftp.Credentials = new NetworkCredential("uname", "pass");
ftp.KeepAlive = false;
ftp.UseBinary = true;
ftp.Method = WebRequestMethods.Ftp.UploadFile;
}
FileStream fs = File.OpenRead(blobfilePath.Replace("https","http"));
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Stream ftpstream = ftp.GetRequestStream();
ftpstream.Write(buffer, 0, buffer.Length);
ftpstream.Close();
But am am getting an error 'URI formats are not supported'.
how can i achieve this..
Thanks in advance.