//this code is for upload,i have successfully uploaded my file in to uploads folder please can anyone tell me how can i get the image from my folder
if(isset($_REQUEST["upload"]))
{
$name=$_FILES;
$type=$_FILES;
$size=$_FILES;
$check=$_FILES;
$uname=str_replace(" ","_",$name);
$tmp_name=$_FILES;

$target_path = "uploads/";

$target_path = $target_path . basename( $uname);

if(move_uploaded_file($_FILES, $target_path))
{
echo "The file ". basename($uname).
" has been uploaded";
$sql ="INSERT INTO files (name,type,size) VALUES('".$uname."','".$type."','".$size."')";
$result=mysql_query($sql);
}
else
{
echo "There was an error uploading the file, please try again!";
}
}

Recommended Answers

All 3 Replies

You have to retrieve the image name from database and then use that name with the path as you have uploaded in the respective folder.

Or

You store the full path with the file name and use both to show the image.
I think this will help you.

You have to retrieve the image name from database and then use that name with the path as you have uploaded in the respective folder.

Or

You store the full path with the file name and use both to show the image.
I think this will help you.

Thanks for the reply please can u show me a demo because i am a newby

i also have same problem....i wana download/copy images from webserver...actually m developing an application in which images/files are uploaded in a folder at web server n now i want a script, to download file to client host? help me plz!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.