Upload dir, Upload contoller, view images
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
/public/hot
|
/public/hot
|
||||||
/public/storage
|
/public/storage
|
||||||
|
/public/upload/*
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
/vendor
|
/vendor
|
||||||
.env
|
.env
|
||||||
|
|||||||
@@ -36,18 +36,18 @@ class Upload extends Controller
|
|||||||
if($fileSize <= $maxFileSize){
|
if($fileSize <= $maxFileSize){
|
||||||
|
|
||||||
// File upload location
|
// File upload location
|
||||||
$location = 'images';
|
$location = 'upload/images';
|
||||||
|
|
||||||
// Upload file
|
// Upload file
|
||||||
$file->move($location,$filename);
|
$file->move($location,$filename);
|
||||||
|
|
||||||
Session::flash('message','Upload Successful.');
|
echo 'Upload Successful.';
|
||||||
}else{
|
}else{
|
||||||
Session::flash('message','File too large. File must be less than 2MB.');
|
echo 'File too large. File must be less than 2MB.';
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
Session::flash('message','Invalid File Extension.');
|
echo 'message Invalid File Extension.';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,6 +183,9 @@
|
|||||||
</b-tab>
|
</b-tab>
|
||||||
</b-tabs>
|
</b-tabs>
|
||||||
</b-card>
|
</b-card>
|
||||||
|
<div v-if="host == 'strecha'">
|
||||||
|
<img src="{{ url('upload/images/camera.jpg') }}" alt="" title="" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user