Re: Copying an uploaded file...
| From: | David T-G | Date: | Wed, 29 Oct 2003 22:55:42 +0000 |
| Subject: | Re: Copying an uploaded file... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168085@lists.php.net to get a copy of this message | ||
Rene --
..and then René Fournier said...
%
% Thanks John. I've simplified and improved the quote per your
% suggestions, but still no dice. (I'[m running OS X 10.2.8.) Here is the
% code:
%
% // MOVE FILE
% if
%
(move_uploaded_file($_FILES['userfile']['tmp_name'],$_FILES['userfile'][
% 'name'])) {
% echo "Success!";
% } else {
% echo "NO!!!";
% }
1) Are you working with multiple files or just one? Here's how my
similar code looks:
move_uploaded_file($_FILES[uploads][tmp_name][$k],"$file.jpg")
or die("Could not move file '$_FILES[uploads][tmp_name][$k]! $!<br>\n") ;
Note the $k in there; it iterates through the files.
2) Let's take one step at a time and just move the file to some name of
your choosing rather than depending on the name it had on the remote
system.
3) BTW, when you print_r() an array you may find <pre></pre> helpful :-)
HTH & HAND & good luck
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!