Support for file uploads
The MVC framework needs to support file / multipart uploads. It should be implemented in a way that uploads are only accepted if they have been announced on beforehand. Could be implemented with a token which is passed along.
Updated by Karsten Dambekalns almost 12 years ago
What we need (to consider):
- a form.file viewhelper
- a file validator of some sort
- applicable to traversable, checks each element
- subclasses as needed (for images, ...)
- a way to "use" files in the code
- filename (better not so directly)
- file instance
If a file is to be bound to a model and should be persisted then the file resource is simply referenced in the model. If you want to manipulate an uploaded file before persisting it, you simply declare the file instance as an action argument and do whatever you need with the file.
Files will be stored in the CR (up to that to decide on filesystem vs DB storage) and most probably also cached in the local filesystem for faster access (data mapper must grok that).