Populate files table with the name of the store file and the folder id

This commit is contained in:
Torsten 2020-02-13 16:32:42 +01:00
parent 192f9973fd
commit 3a01d6680f
8 changed files with 24 additions and 18 deletions

View file

@ -2,7 +2,10 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="eed7de89-f054-487c-bf59-36356758942b" name="Default Changelist" comment=""> <list default="true" id="eed7de89-f054-487c-bf59-36356758942b" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/public/upload/images/Ogga/Roblox_Dropper.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/public/upload/images/Papa_Schlumpf/Roblox_Dropper.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/FileController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/FileController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/public/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/app.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/public/js/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/public/js/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/js/views/Upload.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/Upload.vue" afterDir="false" /> <change beforePath="$PROJECT_DIR$/resources/js/views/Upload.vue" beforeDir="false" afterPath="$PROJECT_DIR$/resources/js/views/Upload.vue" afterDir="false" />
</list> </list>
@ -234,6 +237,9 @@
<workItem from="1580891625747" duration="1061000" /> <workItem from="1580891625747" duration="1061000" />
<workItem from="1580916835678" duration="1903000" /> <workItem from="1580916835678" duration="1903000" />
<workItem from="1580969444691" duration="3286000" /> <workItem from="1580969444691" duration="3286000" />
<workItem from="1581603105382" duration="36000" />
<workItem from="1581605243411" duration="107000" />
<workItem from="1581605492741" duration="1581000" />
</task> </task>
<servers /> <servers />
</component> </component>
@ -257,10 +263,11 @@
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" /> <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
</component> </component>
<component name="WindowStateProjectService"> <component name="WindowStateProjectService">
<state x="419" y="219" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1580891589354"> <state x="1909" y="290" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog" timestamp="1581603136873">
<screen x="0" y="23" width="1280" height="777" /> <screen x="1280" y="23" width="1920" height="1057" />
</state> </state>
<state x="629" y="273" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1580564280549" /> <state x="629" y="273" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1580564280549" />
<state x="1909" y="290" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1581603136873" />
<state x="419" y="219" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.23.1280.777@0.23.1280.777" timestamp="1580891589354" /> <state x="419" y="219" key="#com.intellij.openapi.updateSettings.impl.PluginUpdateInfoDialog/0.23.1280.777@0.23.1280.777" timestamp="1580891589354" />
<state x="1978" y="315" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1580917019448"> <state x="1978" y="315" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1580917019448">
<screen x="1280" y="23" width="1920" height="1057" /> <screen x="1280" y="23" width="1920" height="1057" />
@ -279,10 +286,11 @@
<screen x="0" y="0" width="1920" height="1080" /> <screen x="0" y="0" width="1920" height="1080" />
</state> </state>
<state x="1280" y="23" width="1720" height="857" maximized="true" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1580282545601" /> <state x="1280" y="23" width="1720" height="857" maximized="true" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1580282545601" />
<state x="655" y="365" key="com.intellij.ide.util.TipDialog" timestamp="1580726765734"> <state x="1935" y="380" key="com.intellij.ide.util.TipDialog" timestamp="1581605507447">
<screen x="0" y="0" width="1920" height="1080" /> <screen x="1280" y="23" width="1920" height="1057" />
</state> </state>
<state x="655" y="365" key="com.intellij.ide.util.TipDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1580726765734" /> <state x="655" y="365" key="com.intellij.ide.util.TipDialog/0.0.1920.1080@0.0.1920.1080" timestamp="1580726765734" />
<state x="1935" y="380" key="com.intellij.ide.util.TipDialog/0.23.1280.777/1280.23.1920.1057@1280.23.1920.1057" timestamp="1581605507447" />
<state x="623" y="178" width="673" height="724" key="find.popup" timestamp="1580465329892"> <state x="623" y="178" width="673" height="724" key="find.popup" timestamp="1580465329892">
<screen x="0" y="0" width="1920" height="1080" /> <screen x="0" y="0" width="1920" height="1080" />
</state> </state>

View file

@ -14,10 +14,22 @@ class FileController extends Controller
Log::info("Incoming UploadRequest"); Log::info("Incoming UploadRequest");
$uploadedFile=$request->image; $uploadedFile=$request->image;
$folder=$request->folder; $folder=$request->folder;
Log::info("Folder: '".$folder."'");
$f=Folder::where('name',$folder)->first();
$folder_id=$f->id;
$filename=$uploadedFile->storeAs('./'.$folder,$uploadedFile->getClientOriginalName(),'images'); $filename=$uploadedFile->storeAs('./'.$folder,$uploadedFile->getClientOriginalName(),'images');
$f=new File;
$f->folder_id = $folder_id;
$f->name = $uploadedFile->getClientOriginalName();
$f->save();
return response(['status'=>'success','storedName'=>$filename],200); return response(['status'=>'success','storedName'=>$filename],200);
} }

View file

@ -2148,13 +2148,6 @@ __webpack_require__.r(__webpack_exports__);
// //
// //
// //
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["default"] = ({ /* harmony default export */ __webpack_exports__["default"] = ({

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View file

@ -22,13 +22,9 @@
<button class="button" @click="showContent()" >Show content</button> <button class="button" @click="showContent()" >Show content</button>
<router-link class="button" :to="{ name: 'Login' }">Log-In</router-link> <router-link class="button" :to="{ name: 'Login' }">Log-In</router-link>
<div style="background-color:darkmagenta;"> <div style="background-color:darkmagenta;">
<p>&nbsp; .....<br/></p> <p>&nbsp; .....<br/></p>
</div> </div>
@ -42,9 +38,6 @@
<!-- <form> --> <!-- <form> -->
<label>Ordner wählen:</label> <label>Ordner wählen:</label>
<select @change="newFolderSelected"> <select @change="newFolderSelected">
<option v-for="folder in this.$store.state.folders" :selected="folder.localeCompare(selectedFolder)">{{ folder }}</option> <option v-for="folder in this.$store.state.folders" :selected="folder.localeCompare(selectedFolder)">{{ folder }}</option>
</select> </select>
<!-- </form> --> <!-- </form> -->