PHP Beginner. File uploading is successful but my browser doesn't download the files, instead it reads the file. So i referred other threads and found below code which is not working. I want to download files when i click on the hyperlink download. Selected the path from MySQL database.
$rows = mysqli_num_rows($result);
if($rows>0)
{
while($row = mysqli_fetch_assoc($result))
{
?>
<div> <?php echo $row['Object_Name'];?>
<a href="<?php
$file_url = $row['Object_Path'];
header('Content-Type: application/octet-stream');
header("Content-disposition: attachment; filename=\"".$row['Object_Name']. "\"");
readfile($file_url);
?>">Download</a><br>
</div>
<?php
}
}