title: connecting to FTP server - The remote server returned an error: (550)
body: <p>I'm getting the error "<em>The remote server returned an error: (550) File unavailable (e.g., file not found, no access).</em>" when I call my function sendFile2FTP</p>
  
  <pre><code>    Function sendFile2FTP(fileNameLocal As String, fileNameServer As String, user As String, password As String) As String
  
  
          Dim ftpRequest As Net.FtpWebRequest = Net.WebRequest.Create(fileNameServer)
          ftpRequest.Credentials = New Net.NetworkCredential(user, password)
          ftpRequest.Method = Net.WebRequestMethods.Ftp.UploadFile
          Try
              Dim ficheiro() As Byte = System.IO.File.ReadAllBytes(fileNameLocal)
              Dim ftpStream As System.IO.Stream = ftpRequest.GetRequestStream()
              ftpStream.Write(ficheiro, 0, ficheiro.Length)
              ftpStream.Close()
              ftpStream.Dispose()
  
              Return "True"
          Catch ex As Exception
              Return ex.Message
  
          End Try
  
    End Function
  </code></pre>
  
  <p>And this are the parameters that i'm sending to the function (which are all valid)</p>
  
  <blockquote>
    <p>fileNameLocal -> C:\Users\user\Documents\Visual Studio 2013\Projects\AgenteExportDebitosCC\AgenteExportDebitosCC\bin\Debug\file02-05-2014.xml</p>
    
    <p>fileNameServer -> <a href="ftp://ftp.server.com/intranet/file02-05-2014.xml" rel="nofollow">ftp://ftp.server.com/intranet/file02-05-2014.xml</a><br>
    user -> user </p>
    
    <p>password ->password</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>
  
  <p>Edit:</p>
  
  <p>I'm not sure if this is a permission issue, but I am able to create files with filezilla using the same credentials... </p>