0

//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!";
}
}

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by naveedkhalid
0

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.

0

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

0

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!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.