php picture upload question
Moderator: General Moderators
php picture upload question
Hi I'm creating a php script that will upload a picture to a directory on my webserver but I need it to put the files name mypic.jpg into a variable....how do I instruct php to record the files name and put it to the var?
php does that automatically man...
http://us2.php.net/manual/en/features.file-upload.php
http://us2.php.net/manual/en/features.file-upload.php
so you have a form with a file element, right? and it uploads to a php page, right? on that page (once the file is posted) you have access to a superglobal array called $_FILES... and within that array is this... $_FILES['elementName']['name'] where elementName is the name of the file input element... does that answer your question? 