Import a file outside of EPiServer Programmatically

Vote:
 
Hi, I receive a file outside of EPiServer via ftp. I need to programmatically stream the file into the Unified File System. The file is a spreadsheet so reading line by line would not work. Any ideas would be greatly appreciated
#12999
Apr 05, 2007 19:41
Vote:
 
There is an example in the SDK on how to do this using the UnifiedDirectory.CreateFile method. UnifiedDirectory dir = UnifiedFileSystem.GetDirectory("/upload"); UnifiedFile file = dir.CreateFile("Myfile.txt"); Stream s = file.OpenWrite(); StreamWriter w = new StreamWriter(s); w.WriteLine("Hello world!"); w.Close(); s.Close(); To enable FTP functionality in .NET applications, try the FtpSupport.dll: http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=766E4992-5E9E-46E9-85CA-EF0F0DCECE72
#15234
Apr 10, 2007 9:22
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.