Ссылка на скачивание файл xls, ios - не качает, нужно решить
Цена договорная
•
безналичный расчёт, электронные деньги
Здравствуйте, уже весь инет прошерстил, пробовал методы разные и чет так и не сделал.
Цена договорная.
Делаю ссылку на скачивание .xls, везде вроде ок, качает, а вот на ios, на айфоне, не качает, а тупо открывает, и там непонятно что.
кнопка
<a href="/pricelist/download" download title="Скачать прайс в exсel">
<div class="zapprise"><b>Скачать прайс в exсel</b></div></a>
Прайс генерируется из товаров на сайте и превращается в .xls
action_download - генератор прайса
public function action_download(){
$this->auto_render = FALSE;
require_once dirname(__FILE__) .'/../../helper/PHPExcel.php';
$settings = ORM::factory('Setting')
->find();
$this->file_excell = new PHPExcel();
$glyslyg = explode('<br />',$settings->glyslyg);
if (count($glyslyg)>0){
foreach ($glyslyg as $k=>$row){
$this->file_excell->setActiveSheetIndex(0)->setCellValue('A'.($k+1),strip_tags($row));
if (strpos($row,'strong') OR strpos($row,'<b>')){
$this->file_excell->getActiveSheet()->getStyle('A'.($k+1))->getFont()->setBold(true);
}
}
}
$this->file_excell_counter = count($glyslyg)+2;
$start_headre_row = $this->file_excell_counter;
$this->file_excell->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
$this->file_excell->setActiveSheetIndex(0)->setCellValue('A'.$start_headre_row,'Номенклатура');
$this->file_excell->setActiveSheetIndex(0)->setCellValue('B'.$start_headre_row,'Артикул');
$this->file_excell->setActiveSheetIndex(0)->setCellValue('C'.$start_headre_row,'Цена');
$this->file_excell->setActiveSheetIndex(0)->setCellValue('D'.$start_headre_row,'Наличие');
$this->file_excell->getActiveSheet()->getStyle('A'.$start_headre_row)->getFont()->setBold(true);
$this->file_excell->getActiveSheet()->getStyle('B'.$start_headre_row)->getFont()->setBold(true);
$this->file_excell->getActiveSheet()->getStyle('C'.$start_headre_row)->getFont()->setBold(true);
$this->file_excell->getActiveSheet()->getStyle('D'.$start_headre_row)->getFont()->setBold(true);
$style = array(
'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,
)
);
$this->file_excell->getActiveSheet()->getStyle("A".$start_headre_row.":D".$start_headre_row)->applyFromArray($style);
$this->outTreeExcel(0,0);
$this->file_excell->getActiveSheet()->setTitle('Прайс-лист');
$styleArray = array(
'font' => array(
'size' => 8,
'name' => 'Arial'
));
$this->file_excell->getActiveSheet()->getStyle('A'.$start_headre_row.':D'.($this->file_excell_counter-1))->applyFromArray($styleArray);
for($k=1;$k<=1500;$k++){
$this->file_excell->getActiveSheet()->getRowDimension($k)->setRowHeight(21);
}
$array_symbol = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
foreach ($array_symbol as $symbol){
$this->file_excell->getActiveSheet()->getColumnDimension($symbol)->setAutoSize(true);
}
$BStyle = array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
);
$this->file_excell->getActiveSheet()->getStyle('A'.($start_headre_row).':D'.($this->file_excell_counter-1))->applyFromArray($BStyle);
$this->file_excell->getActiveSheet()->getStyle('B'.($start_headre_row).':D'.($this->file_excell_counter-1))->applyFromArray($style);
if ($settings->loaded()){
$dateFile = date("d.m.Y-H.i",$settings->update_date);
}else{
$dateFile = date("d.m.Y-H.i");
}
$name = iconv("UTF-8","CP1251","Price-Izolux".$dateFile);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$name.'.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($this->file_excell, 'Excel5');
$objWriter->save('php://output');
}
Что я пробовал уже - не помогло
Вставлял в .htaccess
RewriteRule .*\.xls$ - [L,T=application/octet-stream]
AddType application/x-force-download.xls
AddType application/octet-stream .xls
В ссылке атрибут download, не помогает, так как он на ios не пашет.
Цена договорная.
Делаю ссылку на скачивание .xls, везде вроде ок, качает, а вот на ios, на айфоне, не качает, а тупо открывает, и там непонятно что.
кнопка
<a href="/pricelist/download" download title="Скачать прайс в exсel">
<div class="zapprise"><b>Скачать прайс в exсel</b></div></a>
Прайс генерируется из товаров на сайте и превращается в .xls
action_download - генератор прайса
public function action_download(){
$this->auto_render = FALSE;
require_once dirname(__FILE__) .'/../../helper/PHPExcel.php';
$settings = ORM::factory('Setting')
->find();
$this->file_excell = new PHPExcel();
$glyslyg = explode('<br />',$settings->glyslyg);
if (count($glyslyg)>0){
foreach ($glyslyg as $k=>$row){
$this->file_excell->setActiveSheetIndex(0)->setCellValue('A'.($k+1),strip_tags($row));
if (strpos($row,'strong') OR strpos($row,'<b>')){
$this->file_excell->getActiveSheet()->getStyle('A'.($k+1))->getFont()->setBold(true);
}
}
}
$this->file_excell_counter = count($glyslyg)+2;
$start_headre_row = $this->file_excell_counter;
$this->file_excell->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
$this->file_excell->setActiveSheetIndex(0)->setCellValue('A'.$start_headre_row,'Номенклатура');
$this->file_excell->setActiveSheetIndex(0)->setCellValue('B'.$start_headre_row,'Артикул');
$this->file_excell->setActiveSheetIndex(0)->setCellValue('C'.$start_headre_row,'Цена');
$this->file_excell->setActiveSheetIndex(0)->setCellValue('D'.$start_headre_row,'Наличие');
$this->file_excell->getActiveSheet()->getStyle('A'.$start_headre_row)->getFont()->setBold(true);
$this->file_excell->getActiveSheet()->getStyle('B'.$start_headre_row)->getFont()->setBold(true);
$this->file_excell->getActiveSheet()->getStyle('C'.$start_headre_row)->getFont()->setBold(true);
$this->file_excell->getActiveSheet()->getStyle('D'.$start_headre_row)->getFont()->setBold(true);
$style = array(
'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,
)
);
$this->file_excell->getActiveSheet()->getStyle("A".$start_headre_row.":D".$start_headre_row)->applyFromArray($style);
$this->outTreeExcel(0,0);
$this->file_excell->getActiveSheet()->setTitle('Прайс-лист');
$styleArray = array(
'font' => array(
'size' => 8,
'name' => 'Arial'
));
$this->file_excell->getActiveSheet()->getStyle('A'.$start_headre_row.':D'.($this->file_excell_counter-1))->applyFromArray($styleArray);
for($k=1;$k<=1500;$k++){
$this->file_excell->getActiveSheet()->getRowDimension($k)->setRowHeight(21);
}
$array_symbol = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
foreach ($array_symbol as $symbol){
$this->file_excell->getActiveSheet()->getColumnDimension($symbol)->setAutoSize(true);
}
$BStyle = array(
'borders' => array(
'allborders' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
)
)
);
$this->file_excell->getActiveSheet()->getStyle('A'.($start_headre_row).':D'.($this->file_excell_counter-1))->applyFromArray($BStyle);
$this->file_excell->getActiveSheet()->getStyle('B'.($start_headre_row).':D'.($this->file_excell_counter-1))->applyFromArray($style);
if ($settings->loaded()){
$dateFile = date("d.m.Y-H.i",$settings->update_date);
}else{
$dateFile = date("d.m.Y-H.i");
}
$name = iconv("UTF-8","CP1251","Price-Izolux".$dateFile);
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$name.'.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($this->file_excell, 'Excel5');
$objWriter->save('php://output');
}
Что я пробовал уже - не помогло
Вставлял в .htaccess
RewriteRule .*\.xls$ - [L,T=application/octet-stream]
AddType application/x-force-download.xls
AddType application/octet-stream .xls
В ссылке атрибут download, не помогает, так как он на ios не пашет.
В заказе есть исполнитель
При переводе заказа из архивного в актуальный, текущий исполнитель будет снят с задачи.
Выберите тип сделки
С безопасной сделкой вы всегда сможете вернуть средства, если что-то пойдет не так. С простой сделкой вы самостоятельно договариваетесь с исполнителем об оплате и берете на себя решение конфликтов.