Download the PHP package allanmcarvalho/upload without Composer

On this page you can find all versions of the php package allanmcarvalho/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 upload

Upload plugin for CakePHP 3.x

By Allan Carvalho

Installation

1. Installing dependency

You can install this plugin into your CakePHP application using composer. The recommended way to install composer packages is:

2. Loading plugin

In App\config\bootstrap.php

Basic usage

1 - You should open the table and then add the behavior of the plugin Upload.

Note: Just adding the Upload.Upload Behavior does not mean it's ready, in fact, if you just add, nothing will happen. You must define which table columns are going to be responsible for storing the file name as shown above (file1 and file2).

Available Behavior settings

Note: The configuration name must be the same as the table column name. In this example is file1.

Options

  • path: The path where that file will be saved.

Note: When path is not provided, the default is WWW_ROOT . 'files' . DS . $this->table->getAlias() . DS or WWW_ROOT . 'img' . DS . $this->table->getAlias() . DS when the image setting is set.

  • prefix: A prefix to be added to the image file name. Default: Does not have;

Image options:

Note: Compatibility formats to use these settings: jpg, png and gif.

  • crop: (optional) Crop the image. Obs.: If resize is also configured, it will be done before crop. Default: Does not have;
    • width: (at least one) The crop image width. Default: If height is set is the same;
    • height: (at least one) The crop image height. Default: If width is set is the same;
    • x: (optional) The crop image x position based from left. Default: Center;
    • y: (optional) The crop image y position based from top. Default: Center;
    • format: Image format. It can be (jpg, png, gif, same (same as the original)). Default: jpg;
    • quality: Image quality from 1 to 100. Default: 100;
    • preserve_animation: When the image is gif, its animation is not frozen. Format must be same. No changes (thubnails, crop ...) will be made in this image.. Default: false;
    • resize: (optional) Changes the image size. Default: Does not have;
    • width: (at least one) New image width. Default: If height is set is automatic;
    • height: (at least one) New image height. Default: If width is set is automatic;
    • min_size: (at least one) Resize an image from the smaller side. Default: false;
    • thumbnails: (optional) Setting to set thumbnails to be created. Default: Does not have;
    • label: (required) Label for the folder where the thumbnail will be saved. . Default: none;
    • resize: (optional) Changes the image size. Default: Does not have;
    • width: (at least one) New image width. Default: If height is set is automatic;
    • height: (at least one) New image height. Default: If width is set is automatic;
    • min_size: (at least one) Resize an image from the smaller side. Default: false;
    • watermark: (optional) If true follows the default image settings (if exists). If false does not insert the watermark. If any setting is passed in an array, overwrites the default image settings. Default: true;
    • opacity: (optional) Watermak opacity from 1 to 100 where the smaller is more transparent. Default: Same as original.
    • path: (optional) Path to watermark image for this thumbnail. Default: Same as original;
    • position: (optional) Watermak orientation. Default: bottom-right. It can be the same positions quotes below;
    • crop: (optional) Crop the new thumbnail image. Obs.: If resize is also configured, it will be done before crop. Default: Does not have;
    • width: (required) New image crop width. Default:If height is set is the same;
    • height: (required) New image crop height. Default: If width is set is the same;
    • x: (required) The crop image x position. Default: Center;
    • y: (required) The crop image y position. Default: Center;
    • watermark: Insert watermark on image. Default: Does not have;
    • ignore_default: (optional) If true ignores the watermark in the default image. Default: false;
    • opacity: (optional) Watermak opacity from 1 to 100 where the smaller is more transparent. Default: 100.
    • path: (required) Path to watermark image. Default:Does not have;
    • position: (optional) Watermak orientation. Default: bottom-right. It can be:
    • top-left
    • top
    • top-right
    • left
    • center
    • right
    • bottom-left
    • bottom
    • bottom-right

2 - Now should open the view from the form and configure the form and input to be of the file type.

3 - Deleting files without deleting entity

or

Note: The deleteFiles($entity, $fields = []) method is a table method added by behavior and you can even use inside the table class.

4 - Validations

There are two types of validators, one to validate information of the files called UploadValidation, and one that after additional features to validate images called ImageValidation. You can also use the two in one by calling DefaultValidation.

or

or

License: MIT


All versions of upload with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
cakephp/cakephp Version >=3.4.0 <4.0.0
intervention/image Version ^2.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 allanmcarvalho/upload contains the following files

Loading the files please wait ....