php picture upload question

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
calmchess
Forum Commoner
Posts: 33
Joined: Fri Aug 18, 2006 8:14 pm

php picture upload question

Post 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?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

calmchess
Forum Commoner
Posts: 33
Joined: Fri Aug 18, 2006 8:14 pm

Post 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?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

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