Problems with a file upload
| From: | Ulf Tornert | Date: | Thu, 09 Nov 2000 23:15:52 +0000 |
| Subject: | Problems with a file upload | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24576@lists.php.net to get a copy of this message | ||
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"?
Uffe