Copy file from Http to Ftp

Is there a direct way to copy a file from a Http to an Ftp location? Currently, I'm able to download the document to a local directory using the OpenBinaryDirect method, however this only seems to take local paths, and not ftp:// Similarly, I can upload the file to ftp from a local directory using FtpWebRequest, however it cant I can't use a http:// source as a string or variable. This snippet downloads the file to a local directory:

var fileStream = new FileStream(@"C:\%localpath%\file.doc", FileMode.Create); f.Stream.CopyTo(fileStream);

This snippet permits me to upload to an ftp location:

StreamReader sourceStream = new StreamReader(@"C:\%localpath%\file.doc");

I'd like to reference the sharepoint https source directly using OpenBinaryDirect or reference the ftp destination using FtpWebRequest (or HttpWebRequest).

by imoses44 via /r/csharp

Leave a Reply