Download the PHP package mindscreen/fal_upload without Composer

On this page you can find all versions of the php package mindscreen/fal_upload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fal_upload


File Upload using Extbase and FAL in TYPO3 > 6.2

:Author: Michael Telgkamp

:Repository: At Github mindscreen/t3ext-fal_upload

:Credit: - upload_example as inspiration

Overview:

: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?

What needs to be done?

TypeConverter

We want to have a custom TypeConverter to:

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:

<?php
class UploadedFileReferenceConverter extends \TYPO3\CMS\Extbase\Property\TypeConverter\AbstractTypeConverter {

   /**
    * Folder where the file upload should go to
    * (including storage).
    */
   const CONFIGURATION_UPLOAD_FOLDER = 1;

   /**
    * How to handle an upload when the name
    * of the uploaded file conflicts.
    */
   const CONFIGURATION_UPLOAD_CONFLICT_MODE = 2;

   /**
    * Whether to replace an already present resource.
    * Useful for "maxitems = 1" fields and properties
    * with no ObjectStorage annotation.
    */
   const CONFIGURATION_ALLOWED_FILE_EXTENSIONS = 4;
}

Handle validation errors and already attached resources

Different cases need to be handled.

Case: A file is already attached

Knowing about an already attached resource is not only in the domain of the TypeConverter. Therefore the UploadViewHelper assigns such values to a hidden input and protects it by an hash value (hmac).

Additionally the viewhhelper accept child nodes and provides an object "resource". This means that you can render the attached resource if you like to. In this example a preview of the image is shown:

<h:form.upload property="image" >
   <f:if condition="{resource}">
      <f:image image="{resource}" alt="" width="50"/>
   </f:if>
</h:form.upload><br />

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! :: <?php if (!GeneralUtility::verifyFilenameAgainstDenyPattern($uploadInfo['name'])) { throw new TypeConverterException('Uploading files with PHP file extensions is not allowed!', 1399312430); } It cannot be stressed enough how important these three lines of code are! .. important::
    • These lines are mandatory and NOT optional.
    • These lines are independent from the configurable allowed file extensions.

Install

  1. Get from Github, install as extension
  2. Create folder ./fileadmin/content
  3. No extra TypoScript needs to be included
  4. Create an extension and use the classes provided by the plugin
  5. Start playing

Adaptation

Contribute

Enjoy!


All versions of fal_upload with dependencies

PHP Build Version
Package Version
Requires typo3/cms-core Version >=7.5.0,<9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mindscreen/fal_upload contains the following files

Loading the files please wait ....