note 75461 added to features.file-upload
| From: | guillermo dot vigil dot msn+php at gmail dot com | Date: | Thu, 31 May 2007 07:27:32 +0000 |
| Subject: | note 75461 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127047@lists.php.net to get a copy of this message | ||
I've used this for PHP image upload via url, i.e. uploading an image from another website to a
directory within my host.
<?php
if ($_GET[xfer]) {
if ($_POST[from] == "") {
print "You forgot to enter a url.";
} else {
copy("$_POST[from]", "$_POST[to]");
$size = round((filesize($_POST[to])/1000000), 3);
print "transfer complete.<br>
<a><a href=\"$_POST[from]\">$_POST[from]</a><br>
<a><a href=\"$_POST[to]\">$_POST[to]</a> : $size MB";
}
} else {
print "<form action=\"$PHP_SELF?xfer=true\" method=post>
from(http://): <input name=from><br>
to(filename): <input name=to><br>
<input type=submit value=\"transload\">";
}
?>
Surprisingly, it didn't work on my host, but it should on others.
Any tips?
----
Server IP: 69.147.83.197
Probable Submitter: 88.207.184.180
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.php
Edit -- https://master.php.net/note/edit/75461
Del: integrated -- https://master.php.net/note/delete/75461/integrated
Del: useless -- https://master.php.net/note/delete/75461/useless
Del: bad code -- https://master.php.net/note/delete/75461/bad+code
Del: spam -- https://master.php.net/note/delete/75461/spam
Del: non-english -- https://master.php.net/note/delete/75461/non-english
Del: in docs -- https://master.php.net/note/delete/75461/in+docs
Del: other reasons-- https://master.php.net/note/delete/75461
Reject -- https://master.php.net/note/reject/75461
Search -- https://master.php.net/manage/user-notes.php