mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Put file contents instead of file object (creates subdirectory with a single file) (#6760)
This commit is contained in:
parent
27280b8866
commit
de39906cae
|
@ -37,7 +37,7 @@ class AssetFilesController extends Controller
|
|||
foreach ($request->file('file') as $file) {
|
||||
$extension = $file->getClientOriginalExtension();
|
||||
$file_name = 'hardware-'.$asset->id.'-'.str_random(8).'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
|
||||
Storage::put('private_uploads/assets/'.$file_name, $file);
|
||||
Storage::put('private_uploads/assets/'.$file_name, file_get_contents($file));
|
||||
$asset->logUpload($file_name, e($request->get('notes')));
|
||||
}
|
||||
return redirect()->back()->with('success', trans('admin/hardware/message.upload.success'));
|
||||
|
|
Loading…
Reference in a new issue