Is there somewhere a full example of working atk4.2 filestore example code?
I've been searching in docs and stackoverflow and the few examples I have found just aren't working for me.
Do I need to extend Model_File
or Model_Filestore_File
?
First gives me error
Class is not defined in file
Second one gives
Unable to include filestore/lib/Model/Filestore/File.php
What would be the simplest way to add file upload to CRUD?
If you want to have file upload, use the following in your model:
the field should reference filestore_file.id. If you are looking to have a image upload with thumbnail, then:
Once image is uploaded and form is submitted, the "id" of the file will be in respective field. For Field_Image it will also resize the thumbnail. You can further customize this by using your own image model:
This should work fine with 4.2.0, but the "development" branch is currently having some refinements which would allow to have multiple thumbnail sizes per image.