how i can retrive files from folder on hard-disk and how to display uplaoded file data into a textar
Posted
by Deepak Narwal
on Stack Overflow
See other posts from Stack Overflow
or by Deepak Narwal
Published on 2010-02-05T20:26:46Z
Indexed on
2010/03/29
22:03 UTC
Read the original article
Hit count: 267
php
I have made a application form in which i am asking for username,password,email id and user's resume.Now after uploading resume i am storing it into hard disk into htdocs/uploadedfiles/..in a format something like this username_filename.In database i am storing file name,file size,file type.Some coading for this i am showing here
$filesize=$_FILES['file']['size'];
$filename=$_FILES['file']['name'];
$filetype=$_FILES['file']['type'];
$temp_name=$_FILES['file']['tmp_name']; //temporary name of uploaded file
$pwd_hash = hash('sha1',$_POST['password']);
$target_path = "uploadedfiles/";
$target_path = $target_path.$_POST['username']."_".basename( $_FILES['file']['name']);
move_uploaded_file($_FILES['file']['tmp_name'], $target_path) ;
$sql="insert into employee values ('NULL','{$_POST[username]}','{$pwd_hash}','{$filename}','{$filetype}','$filesize',NOW())";
Now i have two questions 1.NOw how i can display this file data into a textarea(something like naukri.com resume section) 2.How one can retrive that resume file from folder on hard-disk.What query should i write to fetch this file from that folder.I know how to retrive data from database but i dont know how to retrive data from a folder in hard-disk like in the case if user want to delete this file or he wnat to download this file.How i can do this
© Stack Overflow or respective owner