h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Upload Single file to FTP Server using C#.net

Upload Single file to FTP Server using C#.net

  public static bool UploadSingleFiles(string fileName,int candidateId,int resumeId)  
     {  
       try  
       {  
         string parentDir = string.Empty;  
         string candir = string.Empty;  
         string desPath = string.Empty;  
         FileInfo objfileInfo = new FileInfo(fileName);  
         parentDir = ClsConfigurations.ReadSetting("Folder");  
         candir = @"/" + parentDir + "/" + Convert.ToString(candidateId);  
         desPath = candir +"-" + Convert.ToString(resumeId) + objfileInfo.Extension;  
         CreateDirectory(candir);  
         objFTPCon.ServerDirectory = candir.Trim();  
         objFTPCon.UploadFile(fileName, desPath);  
         return true;  
       }  
       catch (Exception ex)  
       {  
         Program.WriteLog(ex.Message, ex.StackTrace);  
         return false;  
       }  
     }