0

*我是codeigniter的新手,现在我被困在从服务器下载文件中。基本上我面临两个问题,当我进入页面时,我正在下载一个下载。而且下载后的 excel 文件在下载后不可读:( 。所以任何建议都会非常感谢 :) 快乐编码。*

    <input type="<?php 
$this->load->helper('download');
$name = 'ruby_new.xlsx';
$data = file_get_contents("./downloads/ruby_new.xlsx"); // Read the file's contents - cannot use relative path. It will try to call the file from same directory (controller) as this file. In order for it get the contents from the root folder put a . in front of the relative path//
force_download($name, $data); 
 ?>" class="btn btn-primary btn-small" value="download demo">
4

0 回答 0