title: PHP ftp_put does not upload the file
body: <p>I created an uploader that sends files to the host via FTP in PHP. My file is a photo. It does not just send the photo successfully to the host.
  My code:</p>
  <pre><code>&lt;?php
      $name = $_FILES['cover']['name'];
      $type = $_FILES['cover']['type'];
      $size = $_FILES['cover']['size'];
      $tmp = $_FILES['cover']['tmp_name'];
      $image_properties = getimagesize($_FILES['cover']['tmp_name']);
      $ftpHost   = '*****';
      $ftpUsername = '*****';
      $ftpPassword = '*****';
      
      $connId = ftp_connect($ftpHost) or die(&quot;Couldn't connect to $ftpHost&quot;);
      
      $ftpLogin = ftp_login($connId, $ftpUsername, $ftpPassword);
      $filename=md5($name.microtime()).substr($name,-4,4);
      $namesql=&quot;************.com/7d97481b1fe66f4b51db90da7e794d9f/&quot;.$filename;
      
      if(ftp_put($connId, $tmp, $filename, FTP_ASCII)) {
          echo &quot;File transfer successful - $name&quot;;
          echo &quot;&lt;img src='$namesql' alt='melipic' width='240px'&gt;&quot;;
      }else{
          echo &quot;There was an error while uploading $name&quot;;
      }
      
      ftp_close($connId);
      ?&gt;
  &lt;form role=&quot;form&quot; action=&quot;&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
      &lt;div class=&quot;form-group&quot;&gt;
          &lt;label style=&quot;float:right;&quot; for=&quot;exampleInputEmail1&quot;&gt;cover profile&lt;/label&gt;
          &lt;input name=&quot;cover&quot; type=&quot;file&quot; class=&quot;form-control&quot; id=&quot;exampleInputEmail1&quot;&gt;
      &lt;/div&gt;
      &lt;button name=&quot;btn&quot; type=&quot;submit&quot; class=&quot;btn btn-shadow btn-success&quot;&gt;submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>