* 我是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">