File Download

Hi!!
Can anyone help me out??I somehow managed to upload the files to the local server as well as MySQL database.Problem is with the downloading of file.

echo “<a href='upload/ '” . $row[‘quotation’] . “‘’>” . $row[‘quotation’] . "</a>

With the above code, Index of /CRM/activecertification/upload is opened and if i dont save the files in upload folder on root, the files with be saved loosely.
Is there any alternative for this problem??I want to add that if i use echo “<a href=” . $row[‘quotation’] . “‘’>” . $row[‘quotation’] . "</a> “Object not found!” message id displayed. :injured:

What do you mean by ‘the files with be saved loosely’? You mean when you click on the link it will open the index of the folder instead of downloading the file? Is the selected file stored in the location?

What do you mean by ‘the files with be saved loosely’? You mean when you click on the link it will open the index of the folder instead of downloading the file? Is the selected file stored in the location?

following msg is displayed:

Warning: move_uploaded_file(activecertification/campus interview(Ketan Sir).xlsx) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\CRM\activecertification
ewquotation1.php on line 35

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘C:\xampp\ mp\php21F.tmp’ to ‘activecertification/campus interview(Ketan Sir).xlsx’ in C:\xampp\htdocs\CRM\activecertification
ewquotation1.php on line 35

It seems the problem is with uploading, not downloading. And according to the error message you have got, you don’t have the specified path or you do not have folder ‘activecertification’ created already. So before you need to upload anything in a folder then you have to create it manually or with the help of PHP script.


$path = './activecertification'; // ./ means from the current script file path
if(!file_exists($path)){
    mkdir($path, 777); // create the folder if does not exists
}
// then move or copy file.
if(move_uploaded_file($_FILES['myfile']['tmp_name'], $path . '/' . basename($_FILES['myfile']['name'])){
    echo "upload successfull";
}
else{
    echo "upload failed";
}

Hope you can do rest.