Feature #342

Support for file uploads

Added by Robert Lemke over 11 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
MVC
Start date:
2008-02-20
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

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.


Related issues

Related to TYPO3.Flow - Feature #5660: Implement support for Object Converters Resolved 2009-12-07
Related to TYPO3.Flow - Feature #6008: Automatically purge files of removed resources Resolved 2010-01-13

Associated revisions

Revision 027a4016 (diff)
Added by Robert Lemke almost 10 years ago

[~TASK] FLOW3 (AOP): Removed the "Resource" sub package from the blacklisted sub packages because it now contains a class (Resource) which needs to be persistable.
[-FEATURE][!!!] FLOW3 (MVC): For now removed the request hash feature (HMAC) because it mocks a level of security for incoming data which it doesn't provide. The current mechanism effectively puts control over content security into Fluid templates and it doesn't belong there. Although there might be a need for a request hash, the content security must be implemented by other means. Relates to #4960 and relates to #5659.
[+FEATURE] FLOW3 (MVC): Implemented support for file uploads. Uploading files is cooperation between the Web Request Builder, the Property Mapper and the Resource sub package. The solution included in this commit provides handling of incoming files (including nested arguments) and transparent conversion into Resource objects. Resources (files) are only stored once, no matter how often they are uploaded or what original filename they carried. Still missing: view helper, documentation and automatic purging of unused resource files. Addresses #342.
[~API][!!!] FLOW3 (Property): Renamed the property mapper class to "PropertyMapper" (was just "Mapper" before). Relates to #5658
[+FEATURE] FLOW3 (Property): The Property Mapper now supports a mechanism called Object Converters. These convertes enable the mapper to convert strings, arrays or numbers to certain objects, for example a unix time stamp to a DateTime object. Resolves #5660.
[+FEATURE] FLOW3 (Reflection): Implemented the methods "isPropertySettable" and "isPropertyGettable" for the ObjectAccess class.
[~TASK] FLOW3 (Resource): Renamed the StreamWrapper class to StreamWrapperAdapter
[+FEATURE] FLOW3 (Resource): Implemented a ResourceObjectConverter which is capable of converting arrays or strings to Resource objects.
[+FEATURE] FLOW3 (Utility): Implemented a setValueByPath() method for the Array utilities class.
[+FEATURE] FLOW3 (Utility): Added support for the _FILES super global to the Environment class. The array of information about uploaded files can be obtained in a much cleaner way than PHP provides it by the new getUploadedFiles() method.

History

#1 Updated by Robert Lemke about 11 years ago

  • Target version deleted (1)

#2 Updated by Robert Lemke over 10 years ago

  • Target version set to 283

#3 Updated by Robert Lemke about 10 years ago

  • Target version deleted (283)

#4 Updated by Karsten Dambekalns almost 10 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns

#5 Updated by Karsten Dambekalns almost 10 years ago

What we need (to consider):

  • a form.file viewhelper
  • a file validator of some sort
    • applicable to traversable, checks each element
    • checks
      • size
      • extension
      • mimetype
    • 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).

#6 Updated by Robert Lemke almost 10 years ago

  • Assignee changed from Karsten Dambekalns to Robert Lemke
  • Priority changed from Should have to Must have
  • Target version set to 1.0 alpha 7
  • % Done changed from 0 to 80

#7 Updated by Robert Lemke over 9 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 80 to 100

Also available in: Atom PDF