note 83260 added to function.ftp-put

From: Date: Sat, 17 May 2008 15:08:10 +0000
Subject: note 83260 added to function.ftp-put
Groups: php.notes 
Request: Send a blank email to php-notes+get-139464@lists.php.net to get a copy of this message
Currently, there is no function that lets you specifiy the file's contents as a string. However, there is ftp_fput(), which operates on an open file. Using this function in conjunction with tmpfile() lets you emulate this kind of function. (You could also use php://memory, but this breaks BC). <?php function ftp_fputs($ftp_stream, $remote_file, $contents, $mode, $startpos = 0) { $tmp = tmpfile(); fwrite($tmp, $contents); rewind($tmp); $result = ftp_fput($ftp_stream, $remote_file, $tmp, $mode, $startpos); fclose($tmp); return $result; } ?> ---- Server IP: 217.13.201.10 Probable Submitter: 84.159.82.111 ---- Manual Page -- http://www.php.net/manual/en/function.ftp-put.php Edit -- https://master.php.net/note/edit/83260 Del: integrated -- https://master.php.net/note/delete/83260/integrated Del: useless -- https://master.php.net/note/delete/83260/useless Del: bad code -- https://master.php.net/note/delete/83260/bad+code Del: spam -- https://master.php.net/note/delete/83260/spam Del: non-english -- https://master.php.net/note/delete/83260/non-english Del: in docs -- https://master.php.net/note/delete/83260/in+docs Del: other reasons-- https://master.php.net/note/delete/83260 Reject -- https://master.php.net/note/reject/83260 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139464) next »