note 21428 added to function.ftp-put
| From: | php-general at lists dot php dot net | Date: | Mon, 13 May 2002 03:03:51 +0000 |
| Subject: | note 21428 added to function.ftp-put | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30566@lists.php.net to get a copy of this message | ||
if you are going to upload files more 2mb then you will have to alter your php.ini file!
heres the form...
echo "<FORM METHOD=\"post\" ACTION=\"$action\"
ENCTYPE=\"multipart/form-data\">"
."FTP URL:<BR>"
."<INPUT TYPE=\"Text\" Name=\"ftp_url\" Size=30
AutoComplete=On>"
."<p>"
."FTP PATH: Example( /root_dir/images/banners ) NO TRAILING SLASH<BR>"
."<INPUT TYPE=\"Text\" Name=\"ftp_path\" Size=30
AutoComplete=On>"
."<p>"
."FTP USER NAME:<BR>"
."<INPUT TYPE=\"Text\" Name=\"ftp_user\" Size=30
AutoComplete=On>"
."<p>"
."FTP PASSWORD:<BR>"
."<INPUT TYPE=\"Text\" Name=\"ftp_password\" Size=30
AutoComplete=On>"
."<p>"
."<strong>Browse For File to Upload:</strong><br>"
."<INPUT TYPE=\"file\" NAME=\"source\" SIZE=\"50\">"
."<INPUT TYPE=\"submit\" NAME=\"submit\"
VALUE=\"$button\"><p>"
."</FORM>";
now the code...
$fp = @ftp_connect("$ftp_url");
$login = @ftp_login ($fp, "$ftp_user", "$ftp_password");
@ftp_chdir($fp, $ftp_path);
@ftp_put($fp, $ftp_path/, $source_name, FTP_BINARY);
@ftp_quit($fp);
--
http://www.php.net/manual/en/function.ftp-put.php
http://master.php.net/manage/user-notes.php?action=edit+21428
http://master.php.net/manage/user-notes.php?action=delete+21428
http://master.php.net/manage/user-notes.php?action=reject+21428