title: Upload to FTP server C# using Tamir.SharpSSH
body: <p>Im able to connect with my sftp server and I'm sure of it because I get the list of files of my server and it passes correct list. But I cant upload file to a folder in mysftp server. Here is my code:</p>
  
  <pre><code>  private static void FileUploadUsingSftp(string SFTPAddress, string SFTPUserName, string SFTPPassword,
          string SFTPFilePath, string FileName)
      {
          Sftp sftp = null;
          try
          {
  
              sftp = new Sftp( SFTPAddress,SFTPUserName , SFTPPassword);
  
              // Connect Sftp
              sftp.Connect();
              MessageBox.Show("Connected!");
  
  
  
              //Check if im surely connected
              //list down files in my sftp server folder u01
              ArrayList list;
              list = sftp.GetFileList("//u01");
  
              foreach (string item in list)
              {
                  MessageBox.Show(item.ToString());
              }
              MessageBox.Show(list.Count.ToString());
  
              // upload file 
              sftp.Put(FileName, "//u01"); -----&gt; **I get exception here**
  
              MessageBox.Show("UPLOADED!");
  
  
              // Close the Sftp connection
              sftp.Close();
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.ToString());
          }
          finally
          {
              if (sftp != null)
              {
                  sftp.Close();
              }
          }
      }
  </code></pre>
  
  <p>I recieve this exception:</p>
  
  <pre><code>"Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown."
  at Tamir.SharpSsh.jsch.ChannelSftp.put(String src, String dst, SftpProgressMonitormonitor, Int32 mode)
  at Tamir.SharpSsh.Sftp.Put(String fromFilePath, String toFilePath)
  </code></pre>
  
  <p>I've tried using sftp.Put(FileName,SFTPAddress + "//u01");</p>
  
  <p>Ive tried sftp.Put(FileName,SFTPAddress); And it do work but when I look at my sftp server if the file is there, it isn't. </p>
  
  <p>I've tried sftp.Put(FileName,"//u01"); and it throws the same error.</p>
  
  <p>I must upload my file in a folder in my ftp server and one of the folder is <strong>u01</strong>. </p>
  
  <p>Can anyone help me out. I don't know what's wrong. I'm sure that i'm connected. and when I tried to upload using filezilla it do work so I'm not restricted in writing to our sftp server.</p>