Refined upload code

This commit is contained in:
snipe 2017-10-27 17:40:10 -07:00
parent ec68bd7842
commit b1ac024725

View file

@ -912,8 +912,8 @@ class AssetsController extends Controller
$destinationPath = config('app.private_uploads').'/assets'; $destinationPath = config('app.private_uploads').'/assets';
if ($request->file('image')) { if ($request->hasFile('image')) {
foreach (Input::file('assetfile') as $file) { foreach ($request->file('image') as $file) {
$extension = $file->getClientOriginalExtension(); $extension = $file->getClientOriginalExtension();
$filename = 'hardware-'.$asset->id.'-'.str_random(8); $filename = 'hardware-'.$asset->id.'-'.str_random(8);
$filename .= '-'.str_slug($file->getClientOriginalName()).'.'.$extension; $filename .= '-'.str_slug($file->getClientOriginalName()).'.'.$extension;