Skip to content

Commit

Permalink
Put file contents instead of file object (creates subdirectory with a…
Browse files Browse the repository at this point in the history
… single file) (#6760)
  • Loading branch information
smb authored and snipe committed Mar 5, 2019
1 parent 27280b8 commit de39906
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Assets/AssetFilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function store(AssetFileRequest $request, $assetId = null)
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'));
Expand Down

0 comments on commit de39906

Please sign in to comment.