Beispiel #1
0
 /// <summary>
 /// Uploads files to the Oyster System.		/// 
 /// </summary>
 /// <param name="sourcefiles"></param>
 /// <param name="ShowProgress"></param>
 /// <param name="EncryptFileNames"></param>
 /// <returns>
 /// If EncryptFileNames is true then all files will be given GUID Names on the 
 /// Oyster Server and the GUID Names will be returned
 /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /// Otherwise the original file names will be stored on the 
 /// Oyster Server and the original file names will be returned.
 /// </returns>
 internal string[] UploadFiles(string[] sourcefiles,bool ShowProgress,bool EncryptFileNames)
 {
     FTPTransfer FT = new FTPTransfer();
     OCL.Attachments AS = new Attachments();
     try
     {
         FT.ConnectToOysterServer(ServerAddress);
         //FT.ConnectToOysterServer("ome-prototype");
     }
     catch(Exception Err)
     {
         throw new Exception(Err.Message);
     }
     System.IO.FileInfo[] FI = new System.IO.FileInfo[sourcefiles.Length];
     int i = 0;
     foreach(string CFile in sourcefiles)
     {
         FI[i] = new System.IO.FileInfo(CFile);
         i++;
     }
     string[] EncodedFileNames = new string[1];
     try
     {
         EncodedFileNames = FT.UploadFile(FI,ShowProgress,EncryptFileNames);
     }
     catch(Exception Err)
     {
         throw new Exception(Err.Message);
     }
     return EncodedFileNames;
 }
Beispiel #2
0
        internal bool UploadFile(string sfile, out string EncryptedFileName)
        {
            FTPTransfer FT = new FTPTransfer();
            OCL.Attachments AS = new Attachments();
            try
            {
                FT.ConnectToOysterServer(ServerAddress);
                //FT.ConnectToOysterServer("ome-prototype");
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message);
            }

            try
            {
                bool bResult = FT.UploadFile(sfile, out EncryptedFileName);
                FT.DisconnectFromOysterServer();
                return bResult;
            }
            catch(Exception Err)
            {
                throw new Exception(Err.Message);
            }
        }