File uploading sucks!
このコミットが含まれているのは:
コミット
50a54fb294
|
@ -441,74 +441,31 @@ class StoreController extends Controller {
|
|||
->count();
|
||||
}
|
||||
|
||||
public function moveFile($directory, $name = null) {
|
||||
//if ($this->)
|
||||
}
|
||||
public function makedir(Request $request) {
|
||||
$id = $request->id;
|
||||
|
||||
public function uploadEntry(Request $request) { // /api/rpc/store/entry/upload
|
||||
// Log::info('Res: '.$request);exit();
|
||||
/* if (!mkdir($this->storePath.'/'.$request->id, 0755, true)) {
|
||||
if (!mkdir($this->storePath.'/'.$id, 0755, true)) {
|
||||
Log::error('File MKDIR failed: ');
|
||||
exit();
|
||||
} */
|
||||
}
|
||||
|
||||
if (!mkdir($this->storePath.'/'.$request->id.'/screens', 0755, true)) {
|
||||
if (!mkdir($this->storePath.'/'.$id.'/screens', 0755, true)) {
|
||||
Log::error('Asset MKDIR failed: ');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
// foreach ($request->upfile as $f) {
|
||||
//Log::info('Name: '.gettype($f));exit();
|
||||
// $f->storeAs('store/'.$request->id, $f, 'public');exit();
|
||||
/* if ($f->storeAs('store/'.$request->id, $f, 'public')) {
|
||||
Log::error('File store failed: ');
|
||||
exit();
|
||||
} */
|
||||
// }
|
||||
public function uploadEntry(Request $request) { // /api/rpc/store/entry/upload
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
$id = $request->id;
|
||||
|
||||
foreach ($request->file('imgfile') as $m) {
|
||||
Log::info('Name: '.$m);
|
||||
Log::info('Name: '.gettype('store/'.$request->id.'/screens'));
|
||||
$m->move('store/'.$request->id.'/screens', $m->getClientOriginalName());
|
||||
// $m->storeAs('store/'.$request->id.'/screens', $m, 'public');
|
||||
// $m->store('store/'.$request->id.'/screens', 'public');
|
||||
// if ($m->storeAs('store/'.$request->id.'/screens', $m, 'public')) {
|
||||
// Log::error('Asset store failed: ');
|
||||
// exit();
|
||||
// }
|
||||
}
|
||||
exit();
|
||||
Log::info('Name: '.$request->file('imgfile')); //TMP
|
||||
Log::info('Type: '.gettype($request->file('imgfile'))); // TMP
|
||||
|
||||
/* foreach ($_FILES['fileupload']['tmp_name'] as $key => $files) {
|
||||
if (!empty($_FILES['fileupload']['name'][$key])) {
|
||||
$file_name = $_FILES['fileupload']['name'][$key];
|
||||
$file_tmp = $_FILES['fileupload']['tmp_name'][$key];
|
||||
$request->file('upfile')->move(public_path('storage/store'.$id), $request->file('imgfile')->getClientOriginalName);
|
||||
$request->file('imgfile')->move(public_path('storage/store'.$id.'/screens'), $request->file('imgfile')->getClientOriginalName);
|
||||
|
||||
if (!move_uploaded_file($file_tmp, $this->storePath.'/'.$request->id.'/'.$file_name)) {
|
||||
$error = $error = error_get_last();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_FILES['imageupload']['tmp_name'] as $key => $screens) {
|
||||
if (!empty($_FILES['imageupload']['name'][$key])) {
|
||||
$file_name = $_FILES['imageupload']['name'][$key];
|
||||
$file_tmp = $_FILES['imageupload']['tmp_name'][$key];
|
||||
|
||||
if (!move_uploaded_file($file_tmp, $this->storePath.'/'.$request->id.'/screens/'.$file_name)) {
|
||||
$error = $error = error_get_last();
|
||||
exit();
|
||||
}
|
||||
|
||||
$kage = $key+1;
|
||||
|
||||
if (!rename($this->storePath.'/'.$request->id.'/screens/'.$file_name, $this->storePath.'/'.$request->id.'/screens/'.$kage.'.png')) {
|
||||
$error = $error = error_get_last();
|
||||
exit();
|
||||
}
|
||||
}
|
||||
} */
|
||||
exit(); // TMP
|
||||
|
||||
$add = DB::table('str_file')
|
||||
->insert([
|
||||
|
|
|
@ -105,7 +105,8 @@ export default {
|
|||
path: this.pwd,
|
||||
command: ''
|
||||
}],
|
||||
result: []
|
||||
result: [],
|
||||
group: []
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
|
@ -157,6 +158,12 @@ export default {
|
|||
path: this.pwd,
|
||||
command: ''
|
||||
});
|
||||
|
||||
this.group.push([
|
||||
this.line,
|
||||
this.result
|
||||
]);
|
||||
console.log(this.group);
|
||||
},
|
||||
ls(pwd) {
|
||||
var neopwd = pwd.replace('/', 'sl');
|
||||
|
|
|
@ -52,6 +52,7 @@ Route::get('/api/rpc/store/entry/getentryname/{id}', 'StoreController@getEntryNa
|
|||
Route::get('/api/rpc/store/entry/getentriesincategory/{cat_id}', 'StoreController@getEntriesInCategory');
|
||||
Route::get('/api/rpc/store/entry/countentriesincategory/{cat_id}', 'StoreController@countEntriesInCategory');
|
||||
Route::get('/api/rpc/store/entry/countentriesincategoryfull/{cat_id}', 'StoreController@countEntriesInCategoryFull');
|
||||
Route::post('/api/rpc/store/entry/makedir', 'StoreController@makedir');
|
||||
Route::post('/api/rpc/store/entry/upload', 'StoreController@uploadEntry');
|
||||
Route::post('/api/rpc/store/entry/update', 'StoreController@updateEntry');
|
||||
Route::post('/api/rpc/store/entry/restore', 'StoreController@restoreEntry');
|
||||
|
|
新しいイシューから参照