Re: WHY does file upload work only on local server
| From: | Matthew Kendall | Date: | Sun, 04 Jun 2000 22:50:19 +0000 |
| Subject: | Re: WHY does file upload work only on local server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1004@lists.php.net to get a copy of this message | ||
"helmut ott" <haott@freenet.de> wrote...
> I have a file input field and enter the local file path of the image
> to be uploaded, e.g. c:/images/image1.jpg.
>
> When I submit the form the script replies :
> Warning: Unable to open 'c:\images\image1.jpg for reading
>
> So how can I make the server (apache/unix) read the file in the
> local source-directory and then upload it
You don't. The _server_ does not read the local file - how could it? The
_web_browser_ reads the local file and uploads it as part of the POST data
when the form is submitted. The file ends up in a temporary directory on the
server. The script on the server should open this temporary file and
move/rename it as appropriate. $userfile contains the name of the temporary
file.
http://www.php.net/manual/features.file-upload.php