Re: Problems with a file upload
| From: | (Richard Lynch) | Date: | Fri, 10 Nov 2000 00:36:43 +0000 |
| Subject: | Re: Problems with a file upload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24596@lists.php.net to get a copy of this message | ||
In article <3A0B3028.C7B64C19@privat.utfors.se>, struligt@privat.utfors.se
(Ulf Tornert) wrote:
> --------------220DD5D1A3A3C41F926B84C6
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi,
> I'm using Apache 1.3 (win98) with PHP 3 for educational purposes. At the
> moment I'd like to upload a file from a form and store it on the
> "server". Just for checking I upload a file and then list the available
> info on it, but it won't work. I intend to upload a file from
> C:\path\filename from a form-file-upload-box in HTML. I name it
> "userfile" for later accessing by $username in the recieving
> formhandler. Below is the code for the file upload box:
>
> <INPUT TYPE="file" name="userfile">
>
> In my formhandler (.php3) I list the available information about the
> uploaded file:
>
> Name: <? echo($userfile) ?><BR>
> Original name: <? echo($userfile_name) ?><BR>
> Size: <? echo($userfile_size) ?><BR>
> Type: <? echo($userfile_type) ?>
>
> This prints:
>
> Name: \\php2
> Original name: icq-info.txt
> Size: 39
> Type: text/plain
>
> Warning: Unable to open '\\php2' for reading: No such file or directory
> in c:\program\apache...
>
> I obviously managed to pass the info about $userfile_name, _size and
> _type, but what about the complete filepath? What is happening? Why does
> "echo($userfile)" print "\\php2"?
Hmmmm. It should be in the tmp directory you set in your php3.ini
file... What's that set to? The file may well be showing up and
disappearing -- PHP deletes uploaded files for security reasons. You need
to copy or otherwise process the file in the upload script.
You *might* be able to put sleep(20); at the end of your formhandler.php3
and have the desktop folder to your tmp directory open and see the file in
that 10-second window...
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)