Upload files without intermediary media-tmp

This commit is contained in:
Jonny Barnes 2016-10-10 16:44:41 +01:00
parent c0e12ac5a7
commit a6253f0bd5
3 changed files with 5 additions and 5 deletions

View file

@ -144,11 +144,10 @@ class MicropubClientController extends Controller
if ($request->hasFile('photo')) {
$photos = $request->file('photo');
foreach ($photos as $photo) {
$filename = $photo->getClientOriginalName();
$photo->move(storage_path() . '/media-tmp', $filename);
$multipart[] = [
'name' => 'photo[]',
'contents' => fopen(storage_path() . '/media-tmp/' . $filename, 'r'),
'contents' => fopen($photo->path(), 'r'),
'filename' => $photo->getClientOriginalName(),
];
}
}