Re: Copy files to webserver
| From: | David T-G | Date: | Tue, 15 Apr 2003 12:14:24 +0000 |
| Subject: | Re: Copy files to webserver | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143925@lists.php.net to get a copy of this message | ||
Mike, et al --
..and then Mike Tuller said...
%
% I am trying to create a script that will copy a file to the webserver,
% and I am getting the following error.
%
% Warning:
% copy(/Library/WebServer/Documents/assets/hardware/tmp/
% hardwareexport.txt) [function.copy]: failed to create stream: No such
% file or directory in
% /Library/WebServer/Documents/asset/hardware/importfile.php on line 13
%
% This is the code that I have.
%
% copy ($_FILES['importFile'] ['tmp_name'],
% "/Library/WebServer/Documents/assets/hardware/tmp/"
% .$_FILES['importFile'] ['name']) or die ("Couldn't copy the
file.");
1) Can you have a space in your variable? You have
$_FILES['importFile'] ['tmp_name']
but I would expect
$_FILES['importFile']['tmp_name']
instead.
2) Any reason to not use move_uploaded_file which can handle tihs for
you?
%
% Can anyone see where I am going wrong?
%
% Mike
HTH & HAND
:-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!