[FLOW3-general] RFI: Handling files and file uploads

Manuel Strausz manuel.strausz at chello.at
Thu Dec 31 10:41:04 CET 2009


From: "Karsten Dambekalns" <karsten at typo3.org>
Sent: Monday, November 23, 2009 3:36 PM
> So, from a developers point of view, how would you like to use files and
> file uploads in your work? Just imagine some application you have been
> working on and think of the most pleasurable way this could have been
> done with the perfect framework we try to be(come).

Hey Karsten,
I know I'm a bit late to the party, but I didn't want to comment about it
before I had a better grasp about the internals of the framework.
I guess there are several options regarding handling uploads.
I think what would be cool is to have file uploads register in the resource
manager. I.e. $resourceManager->getUploadedFiles() would return all the
currently uploaded files.
Special validators could take care of validating them similarly to "normal"
arguments, just with regards to file validation. The uploaded files could
just be stored in a temporary directory at first.
Then you could analyze them, move them to a different location, persist
them, or dismiss (delete) them.  It would be good to keep this kind of
operations inside the resource object - so it can keep track of all path
references i.e. when moving the file to a package resource directory.
Generally, the uploaded files could be automatically copied to the current
package's private (or public? maybe a setting for this..) resource
directory, if all validators passed.

If the uploaded files should be mapped to a domain object as object
properties (this might not always be a good idea...), this could also use
the same resource-object as a valueobject for the property mapping. That way
a reference to the resource object can be stored in the persistence backend,
and no binary data dirties the poor DBMS systems running at the far end of
data mapping. This would however require that the resource HAS been moved to
a package directory and is not still rotting in it's temporary upload
directory, else persisting wouldn't make a whole lot of sense.

So I hope this helps a bit and you didn't already implement all of this
anyway ;) Just some thoughts I had after reflecting about your question for
a while.

regards,
Manuel 



More information about the FLOW3-general mailing list