Теглене

  • Автор Автор Anonymous
  • Начална дата Начална дата
<?php
session_start();
require "config.php";
include_once '../common.php';
$id = (int) $_GET['klip'];
$result = mysql_query("SELECT * FROM `klipove` WHERE `id` = '$id' LIMIT 0,1") or die (mysql_error());
$row = mysql_fetch_array($result);
if ($row && file_exists($file = $row['file']))
{
header("Pragma: public");
header('Content-Type: application/octet-stream');
header("Cache-Control: private",false);
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . @filesize($file));
header("Content-Description: File Transfer");
header('Content-Disposition: attachment; filename=' . basename($file));
readfile($file);
exit;
}

header('HTTP/1.0 404 NOT FOUND');
?>
 
мисля че ще е по добре да постнеш все пак коя страница ти се показва в експлорера ? (ненамерен адрес.. но кой ?)

и това localhost го разкарай :)
 
с този код се получава
Код:
<?php
include "config.php"; 
$file = $_GET['klip']; 
header("Pragma: public"); 
header('Content-Type: application/octet-stream'); 
header("Cache-Control: private",false); 
header("Content-Transfer-Encoding: binary"); 
header("Content-Length: " . @filesize($file)); 
header("Content-Description: File Transfer"); 
header('Content-Disposition: attachment; filename=' .basename($file)); 
readfile($file); 
?>
се получава тази грешка
Код:
Warning: readfile(30) [function.readfile]: failed to open stream: No such file or directory in C:\xampp\htdocs\Maxell.bg\video\download.php on line 11
 
офф намери си др функция не readfile
Ако не провери файловете какъв chmod са !?
 

Back
Горе