https://github.com/mindscreen/t3ext-fal_upload
https://github.com/mindscreen/t3ext-fal_upload
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mindscreen/t3ext-fal_upload
- Owner: mindscreen
- Created: 2018-08-03T09:20:06.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-11T15:00:49.000Z (over 6 years ago)
- Last Synced: 2025-04-19T21:18:12.183Z (about 1 year ago)
- Language: PHP
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
================================================
File Upload using Extbase and FAL in TYPO3 > 6.2
================================================
.. post::
:tags: TYPO3, Extbase
.. highlight:: php
.. default-role:: code
:Project:
TYPO3 CMS extension ext:fal_upload for TYPO3 >= 6.2.4
:Author:
`Michael Telgkamp `__
:Repository:
At Github `mindscreen/t3ext-fal_upload `__
:Credit:
- `Helmut Hummel `__ - for his extension `upload_example `__ as inspiration
**Overview:**
.. contents::
:local:
:depth: 3
:backlinks: none
What does it do?
================
This is an extension simplifying the addition of file upload functionality in other extensions.
How does it work?
=================
- The heart of the extension is the UploadedFileReferenceConverter
- an extended FileReference model is needed
- an extended ObjectStorageConverter is needed
- an extended UploadViewHelper is needed
What needs to be done?
======================
TypeConverter
-------------
We want to have a custom TypeConverter to:
- evaluate the file upload array
- move the uploaded file to a FAL storage using the FAL API
- and have the result persisted in the database using the Extbase persistence.
Error handling
--------------
We don't want to just throw exceptions but use the TypeConverter API
to return useful error messages to the user.
Configurability
---------------
Things should be configurable, especially the TypeConverter. It needs to know
about
1. the folder to upload to
2. what to do in case of a name conflict for the uploaded file
3. the allowed file extensions
4. how to deal with an already attached resource.
The actual configuration is done through by PropertyMappingConfiguration.
Some configuration options::
Case: Upload succeeds, validation fails
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this case the file upload succeeds but due to validation errors in some other
fields the whole form isn't accepted. This also means it isn't persisted yet but we
nevertheless want to keep the uploaded file as a resource as we don't want to upload it again.
Security
--------
To make file upload secure the TypeConverter needs at least needs to care about these two issues:
1. Deny upload of PHP files! ::
`__
- `Use the issue tracker for feedback and discussions. `__
Enjoy!