Name from file field

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
skylavelle
Forum Newbie
Posts: 18
Joined: Sun May 04, 2003 11:33 pm
Location: Brisbane, Australia

Name from file field

Post 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>
Last edited by skylavelle on Mon May 19, 2003 5:12 pm, edited 1 time in total.
User avatar
skylavelle
Forum Newbie
Posts: 18
Joined: Sun May 04, 2003 11:33 pm
Location: Brisbane, Australia

Post by skylavelle »

Come on I'm sure someone must know!

Please?
Sky :D
Lonewolf
Forum Commoner
Posts: 33
Joined: Tue May 06, 2003 9:36 pm

Post by Lonewolf »

what do u mean, explain it
Lonewolf
Forum Commoner
Posts: 33
Joined: Tue May 06, 2003 9:36 pm

Post by Lonewolf »

where are u trying to add the image
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

take a look at the members of each entry in $_FILES
http://www.php.net/manual/en/features.f ... hp#AEN5966
User avatar
skylavelle
Forum Newbie
Posts: 18
Joined: Sun May 04, 2003 11:33 pm
Location: Brisbane, Australia

Post 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?
Post Reply