php - Send a variable's content to a file through FTP -
i create file on ftp server variable's content. possible without writing data file locally first ?
this can do:
$tmpfname = tempnam("/tmp", "foo"); file_put_contents($tmpfname, $file_contents) ftp_put($conn_id, $destination_file, $tmpfname, ftp_binary); unlink($tmpfname);
but send $file_contents
without saving first file.
it's possible using wrappers:
ftp_put($conn_id, $destination_file, 'data://text/plain;base64,' . base64_encode($file_contents), ftp_binary);
Comments
Post a Comment