Voting

: min(three, four)?
(Example: nine)

The Note You're Voting On

chris [at] pureformsolutions [dot] com
19 years ago
I found this function useful when uploading a file through FTP. One of the files I was uploading was input from a textarea on the previous page, so really there was no "file" to upload, this solved the problem nicely:

<?php
# Upload setup.inc
$fSetup = tmpfile();
fwrite($fSetup,$setup);
fseek($fSetup,0);
if (!
ftp_fput($ftp,"inc/setup.inc",$fSetup,FTP_ASCII)) {
echo
"<br /><i>Setup file NOT inserted</i><br /><br />";
}
fclose($fSetup);
?>

The $setup variable is the contents of the textarea.

And I'm not sure if you need the fseek($temp,0); in there either, just leave it unless you know it doesn't effect it.

<< Back to user notes page

To Top