Aw: Download-Problem mit InternetExplorer 8
@webdesigner
Kannst du mir bitte zeigen an welche Stelle der Code genau hin muss.
function getfile(){
$jshopConfig = &JSFactory::getConfig();
$db = &JFactory::getDBO();
$id = JRequest::getInt('id');
$oid = JRequest::getInt('oid');
$hash = JRequest::getVar('hash');
$order = &JTable::getInstance('order', 'jshop');
$order->load($oid);
if ($order->file_hash!=$hash){
JError::raiseError(500, "Error download file");
return 0;
}
if (!in_array($order->order_status, $jshopConfig->payment_status_enable_download_sale_file)){
JError::raiseWarning(500, _JSHOP_FOR_DOWNLOAD_ORDER_MUST_BE_PAID);
return 0;
}
$items = $order->getAllItems();
$filesid = array();
foreach($items as $item){
$arrayfiles = unserialize($item->files);
foreach($arrayfiles as $_file){
$filesid[] = $_file->id;
}
}
if (!in_array($id, $filesid)){
JError::raiseError(500, "Error download file");
return 0;
}
$stat_download = $order->getFilesStatDownloads();
if ($stat_download[$id] >= $jshopConfig->max_number_download_sale_file){
JError::raiseWarning(500, _JSHOP_NUMBER_DOWNLOADS_FILE_RESTRICTED);
return 0;
}
$file = &JTable::getInstance('productFiles', 'jshop');
$file->load($id);
$downloadFile = $file->file;
if ($downloadFile==""){
JError::raiseWarning('', "Error download file");
return 0;
}
$file_name = $jshopConfig->files_product_path."/".$downloadFile;
if (!file_exists($file_name)){
JError::raiseWarning('', "Error. File not exist");
return 0;
}
$stat_download[$id] = intval($stat_download[$id]) + 1;
$order->setFilesStatDownloads($stat_download);
$order->store();
ob_end_clean();
@set_time_limit(0);
$fp = fopen($file_name, "rb");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: application/octet-stream");
header("Content-Length: " . (string)(filesize($file_name)));
header('Content-Disposition: attachment; filename="' . basename($file_name) . '"');
header("Content-Transfer-Encoding: binary");
while( (!feof($fp)) && (connection_status()==0) ){
print(fread($fp, 1024*8));
flush();
}
fclose($fp);
die();
}