PDA

View Full Version : finding file address on host


earthsiege
08-27-2004, 01:51 PM
hey guys,
im trying to allow the user to pick a couple of files to upload but the thing is how are you supposed to allow the user to browse.
i tried using the html tag <input type='file'> which give you a nice little browse button but the output from that isnt the file location so when you print something like $variable it gives a loction on my temp drive...
i dont even know whether this question is relevant to php but because im using php to upload the files so i thought id post this question here.
any help would be welome.

raf
08-27-2004, 02:45 PM
if the user browses to a file on his HD and submits the form, then the files are uploaded to your serer and put in a temporarely directory. You can then move it from that directory to the location where you want to store them.

more info ad examplecode here

http://www.php.net/features.file-upload

earthsiege
08-27-2004, 04:11 PM
cool stuff but ive already gone through it,
the thing is i need the file location in order to allow the user to preview image files before actually ftp to the site by having something like <img src="....">
, after looking around some people told me to use javascript but im not 2sure because i dont really use javascript for anythingbut form validations and small functions...