Reputation: 433
I have a form having multiple upload fields. Let's assume a thumbnail image and the large image. Now using the FuelPHP how can i save this two files to two different locations renaming them to name desired.
For example: I want to save the thumbnail to media/images/thumbnail/db_record_id/thumbnail.extension and the large image to media/images/large/db_record_id/thumbnail.extension
using the answer to this question Multiple uploads to different directories using FuelPHP, I can upload to the desired directories but how to give the desired name?
Upvotes: 0
Views: 203
Reputation: 2574
If you want full control, register a 'before' callback.
If will be called before saving the file, with the File object of that file. It's passed by reference, so you can alter whatever you want.
Upvotes: 1