title: PHP upload to FTP from file contents
body: <p>While you can upload files to an FTP server with <code>ftp_put</code>, that would need a file that you want to upload. What if the contents of a file are inside a MySQL field?</p>
  
  <p>How can I upload a file that lives in a MySQL BLOB field to an FTP server (so upload a file from a string containing file data instead of a file path)? I'm looking for a native solution, not a workaround. This because writing the data to a file, uploading the file, and deleting a file would take too long.</p>
  
  <p><strong>Edit to clarify the OP's question:</strong> I have a string variable that I want to upload to an FTP server. The quick and dirty way is to create a physical temporary file from my string variable, upload that file to the FTP server, and then delete the temporary file. But is there a way to upload the string variable directly to the FTP server without having to create a temporary file from it?</p>