how to find the path of temp folder, used to store image

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
mianmajidali
Forum Commoner
Posts: 30
Joined: Tue Dec 01, 2009 8:05 pm

how to find the path of temp folder, used to store image

Post by mianmajidali »

hi to all,
i m new to php and trying to upload, save, and display image from mySQL using php, i have a domain online and working by uploading page again and again after changing on it, it has also cPanel.
i have got extenssion of image but now i dont know, where does the server store real (physically) image on server ??
some one has told mn that, the image uploaded by user stores in temp folder with .tmp extenssion, we have to get image from them and rename it with adding extenssion which we got first, then it will have to copy into database.
please tell me, where the tmp folder is located ?? how can i use its path in my php.


best regards:
meji
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: how to find the path of temp folder, used to store image

Post by Christopher »

Images need to be stored in the public HTML directory for them to be accessible. That is the same directory that your PHP scripts are in. Usually people put images in a 'images' directory. So when you upload, you would put everything in the public HTML directory.

Users uploading with HTTP is a different thing. You should use the move_uploaded_file() function. That function verifies that the file is actually an uploaded file.
(#10850)
Post Reply