2015-07-02 22 views
0

我有一個窗體,它有5個文件輸入來創建一個圖像數組。循環訪問映像數組並移動它們 - Laravel

處理時,我希望遍歷圖像並處理它們。

$images = Input::get('images'); 
// image proccessing 
foreach ($images as $image) { 
    print_r($image); 
} 

將輸出文件名,但如果我呼籲$圖像變量的移動功能,我得到「呼籲字符串的方法舉動」。

我應該怎麼做?

回答

0
You should be doing something like this 

     $input = Input::file('files'); //get file as input 
     //check if input has file 
     if ($input){ 
      foreach($input as $key){ 
      //loop through file and perform action... 
       $array = Image::file_upload($key, 'file', 'Images'); 
       // I assume you have your method for upload like the above 
       $key = $array['filename']; 
       print_r($key);  
      } 
     } 
     $this->image->save($input); //save to db file name. 
相關問題