Re: Re: Upload file field not working as a form element
| From: | Lowell Allen | Date: | Sun, 21 Mar 2004 14:23:04 +0000 |
| Subject: | Re: Re: Upload file field not working as a form element | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181079@lists.php.net to get a copy of this message | ||
> All I am trying to do is insert the file name, not the file. The file is
> being uploaded to the server in a specific location. All I need is the
> filename inserted into the database. I've gotten the upload part to work and
> everything I just can't get the file name inserted for God knows what
> reason. I removed the upload code and am simply trying to insert the
> filename and userid into the database. The userid goes in but I cannot get
> the file name inserted.
>
> Here is the form:
> <form action="<?php echo $editFormAction; ?>" method="post"
> enctype="multipart/form-data" name="form1">
> <input name="filename" type="file"
> id="filename">
> <input name="userid" type="hidden"
> id="userid"
> value="<?php echo $row_rsUSER['id']; ?>">
> <input type="submit" name="Submit2"
> value="Upload"
> disabled>
> <input type="hidden" name="MM_insert"
> value="form1">
> </form>
The uploaded file name will be $HTTP_POST_FILES["filename"]["name"] -- use
that rather than $_POST["filename"].
HTH
--
Lowell Allen