Download the PHP package doris/yii2-upload-file without Composer

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

File Uploader Widget

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

yii2-upload-file

Required params

model - required ( object - \yii\db\ActiveRecord )
form  - required ( object - \yii\widgets\ActiveForm )
uploadType - required (allow types are - Uploader::UPLOAD_TYPE_IMAGE | Uploader::UPLOAD_TYPE_VIDEO | Uploader::UPLOAD_TYPE_FILE | Uploader::UPLOAD_TYPE_AUDIO )
language - required ( allow languages are - en-US | ru-RU | uk-UA )
attributes - required (array, attribute - needs for saving file name to db and validate (in model rules), tempAttribute needs for transfer uploaded file from asociative array $_FILES, it is public property in your model)
uploadPath - required (type string)  

Additional properties

moduleName - not required, if you use basic version Yii2 you must set muduleName (it is name of you admin module, you may find it in your config file).  
urlOptions - not required (by default uploadUrl => upload-file, deleteUrl => delete-file), you may set your custom urls and determine them in your controller 
options => [
    1) multiple - by default false,
    2) uploadMineType - depends on param uploadType, if this option will not be specified upload file widget automaticaly determine uploadMineType.
         You may set another mineTypes using doris\uploadFile\helpers\UploadHelper. 
         There where some methods fo set mine types: 
          - UploadHelper::uploadMineTypeForImages()
          - UploadHelper::uploadMineTypeForVideo()
          - UploadHelper::uploadMineTypeForAudio()
         Or set your custom mine type in string format
    3) maxFileSize - this property indicated in the format integer or double, by default 3 MB (example 3, 0.2 ....)      
    4) resize - [
        'resizeWidth' => 450,
        'resizeHeight' => 450,
    ]
        Proportional resize by width and height - only for 'uploadType' => Uploader::UPLOAD_TYPE_IMAGE
        If resize option was specified you must identify resizeWidth and resizeHeight, they wiil be required.         
    5) fileMineType => FileUploader::MINE_TYPE_PDF | FileUploader::MINE_TYPE_EXCEL | FileUploader::MINE_TYPE_DOCUMENT
        This property works with uploadType => Uploader::UPLOAD_TYPE_FILE, by default have fileMineType value FileUploader::MINE_TYPE_PDF 
]
templateOptions => [
    1) uploadLimitWindow - show bootstrap alert window with resize information, by default true.
     Depends on resize option, if resize option was not specified uploadLimitWindow param will have false value. 
    2) bootstrapOuterWrapClasses -  by default col-xs-12 col-sm-12 col-md-12 col-lg-12, you may set your custom classes.
    2) bootstrapInnerWrapClasses -  by default col-xs-12 col-sm-12 col-md-12 col-lg-12, you may set your custom classes.
] 

NOTE: You must set in params.php domain name (example 'domain' => 'http://example.domain'), for stable generating path for preview.

NOTE: If you using basic version Yii2 you must set moduleName option, for stable generating urls to default processing actions.

Usage

Controller

View

Upload image example

Upload video example

Upload file example

Upload audio file example


All versions of yii2-upload-file with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
yiisoft/yii2 Version ~2.0.0
yiisoft/yii2-imagine Version ^2.1
2amigos/yii2-file-upload-widget Version ~1.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 doris/yii2-upload-file contains the following files

Loading the files please wait ....