mysql - PHP upload to FTP from file contents -


When you can upload files to an FTP server with ftp_put , you get a file Would you like to upload if the contents of a file are within a MySQL field?

I can upload a file that resides on an FTP server in a MySQL BLOB field (hence upload file from strings instead of file file to a file path)? I'm looking for a native solution, not an alternate solution, because writing files in the file, uploading a file, and removing the file will take a lot of time.

To clarify the question of OP, edit: I have string variables I want to upload to an FTP server to create a physical temporary file from my string variable Quick and dirty, upload that file to an FTP server, and then delete the temporary file. But is there any way to upload strings variables directly from FTP server without making it a temporary file?

OK, I got a solution.

  $ fileContent = 'The contents of my file here'; $ Contentstream = fopen ('Data: // text / plain,' $ FileContent, 'r'); Ftp_fput ($ myConnection, '/path/to/my/folder/file.txt', $ content stream, FTP_BINARY);    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -