Re: Uploading Files
| From: | Jason | Date: | Fri, 04 Oct 2002 21:08:00 +0000 |
| Subject: | Re: Uploading Files | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118907@lists.php.net to get a copy of this message | ||
Okay, I checked out the link listed below, and tried using what is given
there, but I get the following error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
d:\www_root\locutus\phpman\admin\test.php on line 16
Here's the code that I am using:
<form enctype="multipart/form-data" action="test.php"
method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
<?php
move_uploaded_file($_FILES['userfile']['tmp_name'],
"../images/$_FILES['userfile']['name']");
?>
I am able to get rid of this error, but changing the line to:
move_uploaded_file($_FILES['userfile']['tmp_name'],
"../images/$_FILES[userfile][name]");
However, the file is then uploaded as Array[name]
How do I get past this?
Jason Williard
"Eriol" <eriol@eriol.com> wrote in message
news:20021004202251.85000.qmail@pb1.pair.com...
>
> "Jason" <jasonw@pacifier.com> disgorged:
>
> : I would like to be able to upload files from the client computer to the
> : server via a form. I know how to build the form, but am not sure of the
> : best way to process this. I know there are certain ftp functions that
can
> : do this, which I'm not sure how to use. Are there any others?
>
> ====
>
> http://www.php.net/manual/en/features.file-upload.php
>
> More specifically, move_uploaded_file() and is_uploaded_file()
>
> HTH..
>
> Take care.. peace..
> eriol
>