0
我想這些圖像下載到硬盤驅動器,但沒有運氣使用笨下載類和標準的PHP圖像下載到硬盤笨PHP的
<code>Click <a href="<?php echo base_url()."download";?>">HERE</a> To Download</code>
控制器
function download(){
$this->load->helper('download');
$students =$this->db->get('students')->result();
$images=explode(',',$students->images);
for($i=0;$i<sizeof($images)-1;$i++){
//$path = base_url().$images[$i];
$data =get_file_contents(base_url().$images[$i]);
$img = base_url().$images[$i];
$contents = explode('/', $img);
$name = "test.jpg";
$download = force_download($name,$data);
}
它只輸出空白屏幕
,但會在href知道哪個圖像中的每個鏈接將下載一個圖像,請參閱圖像屬於一個用戶和用戶配置文件,所以我應該把它們放在與用戶相同的功能或我把它們放在一個單獨的文件夾中 –
它不工作在同一個空白頁面 –
讓我看看錶結構,所以我可以爲您提供更詳細地回答。 – molagbal