實作了多圖上傳,上傳的資料夾都有圖片,但上傳到資料庫只有一條數據,我要怎麼做,我要怎麼寫控制器
html程式碼<input type=" file" name="image[]" /> <br>
#控制器要怎麼寫,求指示
public function upload(){
// 取得表單上傳檔案例如上傳了001.jpg
$files = Request::instance()->file('image');
for instance ){
$info = $file->move('upload');
> Object
(
[error:thinkFile:private] =>
[filename:protected] => C:wamptmpphpC8C2。 => date
[ validate:protected] => Array
)
[isTest:pro?
[key] => image
[name] => 5.jpg
[type] => image/jpeg
[tmp_name] => C:wamptmpphpC8C2.tmp
[enclosure:SplFileObject:private] => "
列印資料後就能看到 資料結構 按這個結構處理就行了
public function upload(){
// 取得表單上傳檔案例如上傳了001.jpg
$files = Request::instance()->file('image');
for instance ){
$info = $file->move('upload');
> Object
(
[error:thinkFile:private] =>
[filename:protected] => C:wamptmpphpC8C2。 => date
[ validate:protected] => Array
(
)
[isTest:pro?
[key] => image
[name] => 5.jpg
[type] => image/jpeg
[tmp_name] => C:wamptmpphpC8C2.tmp
[error] = 0 ) [hash:protected] => Array ( ) [pathName:SplFileInfo:private] => C:oamp phpC8C2.tmp [openMode :SplFileObject:private] => r [delimiter:SplFileObject:private] => , [enclosure:SplFileObject:private] => "[enclosure:SplFileObject:private] => "
[enclosure:SplFile列印資料後就能看到 資料結構 按這個結構處理就行了