Best Way To Add Filesystem Storage To A Model
Posted 28 June 2013 - 03:31 AM
What is the best way to integrate this into a model?
I'd like the ActiveRecord model to handle the storing and retrieving automatically as if the upload was stored in the database itself.
What is the best way to implement this, are there perhaps applicable examples or extensions out there?
Posted 30 June 2013 - 02:47 PM
Can anyone confirm if that is the best way to go or are there alternatives?
Posted 30 June 2013 - 08:24 PM
Probably you have a specific use case in your mind ... like 1) user uploads an image file 2) allows the user to edit it 3) updates the file ... or something similar.
As far as I know, there's no official support for it in CActiveRecord.
There's a lot of extensions that try to handle image files ... I haven't tried any of them so far, but I would want to try this one first. http://www.yiiframew.../extension/img/
Posted 01 July 2013 - 03:33 AM
My problem isn't related to handling the uploaded file, but more that I want to influence how CActiveRecord does the storage for me as Softark understood correctly. It's good to hear that there is no real support for what I want, I at least understood things right how everything works
The img extension is a nice one to look at since it does in some way do what I want. I'll look at that code and use that for inspiration.