Page 1 of 1

Name from file field

Posted: Mon May 19, 2003 7:39 am
by skylavelle
Does anyone know how to extract the name from a file field so I can insert it into my database???

<form action="" method="post" enctype="multipart/form-data" name="insert" id="insert">
<br>
Image:
<input name="file" type="file" id="file">
<br><br>
<input name="submit" type="submit" id="submit" value="Add">
<INPUT NAME="add" TYPE=Hidden Value="yes" Size="">
<INPUT NAME="auto" TYPE=Hidden Value="0000" Size="">
</form>

Posted: Mon May 19, 2003 5:12 pm
by skylavelle
Come on I'm sure someone must know!

Please?
Sky :D

Posted: Mon May 19, 2003 5:23 pm
by Lonewolf
what do u mean, explain it

Posted: Mon May 19, 2003 5:24 pm
by Lonewolf
where are u trying to add the image

Posted: Mon May 19, 2003 5:25 pm
by volka
take a look at the members of each entry in $_FILES
http://www.php.net/manual/en/features.f ... hp#AEN5966

Posted: Mon May 19, 2003 5:40 pm
by skylavelle
I have created an image uploader and an insertion for my database on one php.

It uploads the image fine and insert the rest of the textual fields, which above are not mentioned, into the database.

However, I want to know if there is a way of taking the name from the file field and placing in front of the path. At the moment I have the path and are forced to have another text field present where the user must enter the file name. These to are merged and the file and its path is place on the database.

I want to be able to remove this last text field and in order to do so I have to take the name from the file field when you choose what file you want to upload.

Any ideas?