Page 1 of 1
php picture upload question
Posted: Fri Jan 05, 2007 11:55 am
by calmchess
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?
Posted: Fri Jan 05, 2007 12:05 pm
by Luke
Posted: Fri Jan 05, 2007 1:48 pm
by calmchess
well I think you misunderstand I need to echo the file name so that the file name can then be sent to a flash page......how would I echo the pics file name from the php upload page?
Posted: Fri Jan 05, 2007 2:18 pm
by Luke
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?
