0

Hi all,

Im wanting to have an "upload picture" button, that on clicking will upload the picture into a directory, but then capture only the filename of the picture to be stored in the database.

This is for creating a catalogue entry.

Im fine with the form information and disabling parts after upload, so i guess i only need to know how to capture a name of a file.

Any direction would be appreciated

regards

paul

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by whiteyoh
0

When using a form to upload files, (input type="file") you can get the name of the file this way:

$name = $_FILES['upload']['name'];

Assuming that your form looks like this:

<form method="post" action="upload.php">
<input type="file" name="upload" value="" maxlength="200" size="40">
<input type="submit" value="submit">
</form>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.