mardi 16 août 2016

Move or copy a file from the request to multiple locations

I'm using Laravel and taking in input and file uploads. This page takes changes that users want to make to an order. The end goal is to take this input and apply it to multiple orders.

I can reuse the input for each of the orders. But what would be a good way for me to copy that file in the request to multiple directories? For example, as in the documentation, I originally have: $request->file('photo')->move($destinationPath, $fileName); which works fine for one order. But now that I want to apply it to many orders, I can't move that same file from the request anymore since it doesn't exist.

And it looks like the UploadedFile object doesn't have a copy() method. Any ideas would be appreciated. Thank you.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire