ปัญหาดาวน์โหลดข้อมูลไม่ได้ครับ ช่วยทีครับ ขึ้นObject not found! The requested URL was not found on this server.
ปัญหาดาวน์โหลดข้อมูลไม่ได้ครับ ช่วยทีครับ ขึ้นObject not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
Code (PHP)
<?php
include("config.php");
if(isset($_GET['file_pdf'])){
$gard = mysql_query("SELECT `id_file`,`sub_name`,`toppic`,`code_sub`,`delel1`,`file_pdf` FROM subject INNER JOIN uploadfilesub ON subject.sub_id=uploadfilesub.sub_id WHERE `file_pdf`= '".$_GET['file_pdf']."'limit 0,1")or die (mysql_error());
$data = mysql_fetch_array($gard, MYSQLI_ASSOC);
$file =$data['file_pdf'];
$name = "gard/";
$kk5 = $name.$file;
header("Content-Disposition: attachment; filename=" .urlencode($file) );
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Description: File Transfer");
header("Content-Length:". filesize($kk5));
flush();
$fp = fopen($kk5, "r");
while(!feof($fp)){
echo fread($fp, 65536);
flush();
}
fclose($fp);
}
?>
Tag : PHP, MySQL, CakePHP
Date :
2015-12-23 03:00:45
By :
Pimmawin
View :
1368
Reply :
1
ไฟล์ส่งข้อมูลครับ
Code (PHP)
$gard = mysql_query("SELECT `id_file`,`sub_name`,`toppic`,`code_sub`,`delel1`,`file_pdf` FROM subject INNER JOIN uploadfilesub ON subject.sub_id=uploadfilesub.sub_id WHERE sub_name ='Design and Analysis of Experiments'")or die (mysql_error());
if (mysql_num_rows($gard)==0){
echo"No any User";
}
else{
?>
<?php
while ($row = mysql_fetch_array($gard, MYSQLI_ASSOC)) {
?>
<tr>
<td><?php echo $row['code_sub']; ?></td>
<td><?php echo $row['sub_name']; ?></td>
<td><?php echo $row['toppic']; ?></td>
<td><?php echo $row['delel1']; ?></td>
<td><?php echo $row['file_pdf']; ?> </td>
<td><a href="download2.php?id=<?php echo $row['file_pdf']; ?>">download</a>
</tr>
<?php
Date :
2015-12-23 03:03:34
By :
Pimmawin
Load balance : Server 05