473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how i can retrive files from folder on hard-disk and how to display uplaoded file dat

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
Expand|Select|Wrap|Line Numbers
  1. $filesize=$_FILES['file']['size'];
  2. $filename=$_FILES['file']['name'];
  3. $filetype=$_FILES['file']['type'];
  4. $temp_name=$_FILES['file']['tmp_name'];   //temporary name of uploaded file
  5. $pwd_hash = hash('sha1',$_POST['password']);        
  6.  
  7.  
  8.  
  9. $target_path = "uploadedfiles/";
  10. $target_path = $target_path.$_POST['username']."_".basename( $_FILES['file']['name']); 
  11.  
  12. move_uploaded_file($_FILES['file']['tmp_name'], $target_path) ;   
  13.  
  14. $sql="insert into employee values    ('NULL','{$_POST[username]}','{$pwd_hash}','{$filename}','{$filetype}','$filesize',NOW())";
  15.  
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
Feb 5 '10 #1
1 1951
Atli
5,058 Expert 4TB
Hey.
  1. You can get the actual data from the file by using the file_get_contents function. After that it is just a matter of echoing it wherever you need it.
  2. The same way you created it. You just fetch the data from the database, compile the file path using the username and filename, and the do whatever you need to do with it from there. Print it, link to it, unlink it, or whatever you want to do.
Feb 5 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dansan | last post by:
I have several files in some of my projects that are not 'code' files, but that are definately necesary to run the programs (such as .xsd files, .txt files, and others). I have been trying to find...
4
by: Jerry | last post by:
I'm having just a bit of trouble wrapping my brain around the task of working with folders that are above the site's root folder. I let users upload photos (.jpg/.gif files) which can...
11
by: Maximus | last post by:
Hi all, Has anyone been able to reterive the gradient selection colors used in outlook 2003? Basically, I have a grid showing a list of records and my client wants the selected row to have the...
6
by: Smokey Grindle | last post by:
I need to ensure that there are NO files in the target folder of a setup project, I want to delete anything in the folder first before the install takes place (all from inside the installer program...
2
by: =?Utf-8?B?TWF0dCBGaW5pc2g=?= | last post by:
I was transferring files/documents onto an external hard drive and accidentally wiped my "My Documents" folder with a lot of important files, documents etc. Can anyone tell me how to recover them -...
0
nehashri
by: nehashri | last post by:
hi, I need one help regarding Asp with MsAccess database. Problem. ======== i want to retrive stored image from the MSAccess database using asp.
4
by: Karl | last post by:
Hi all, I want to write an application that is launched from the context menu in Windows Explorer/Computer. That is to say, when I am browsing around my hard drive and get to any location I...
2
by: bollinenivedi | last post by:
how can i insert and retrive mp3 files from sql server can send any one code for that pls to my mail (Email Removed)
1
dima69
by: dima69 | last post by:
Hi everybody. I develop a commercial MSAccess application. Until now, the default folder for my installation was "Program Files" - because this is the "conventional" way. However, I discovered that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.