Download the PHP package sar-cubet/file-upload without Composer

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

Laravel File Upload

License

This is a Laravel package that provides file upload functionality with ease. It simplifies the process of handling file uploads in your Laravel application.

Features

Requirements

Installation

You can install the package via Composer. Run the following command:

composer require sar-cubet/file-upload

Installing the package (publishing the resources)

php artisan fileupload:install

Implementation

We provide SarCubet\FileUpload\Facades\Upload Facade which you can use to perform operations like file validation, image optimization, file storage etc. You can validate your file by using the Upload::validate() method. The Upload::validateFile() accepts a file of type Illuminate\Http\UploadedFile and return a Illuminate\Support\Facades\Validator object that you can use as per the application requirement. All the supported file types can be found inside the config file config/fileupload.php (which will be published). You can modify the config as per your requirement. Also if you wish to add any other file types, you can add it up inside allowed_file_extensions.others list in the config file.

If you want to use custom validation and/or validation messages you can pass the rules and messages as an associative array (optional)

If you wish to scan the uploaded file for any type of malwares. You can use the Upload::scanFile() method(Note: Its recomented to use before using validateFile() or any other services.). Under the hood we are making use of ClamAV anti-virus scanner. So you need to install ClamAV in your machine. Here are the commands for installation (Ubuntu):

Additionally you can use isFileInfected() and getMalwareName() methods identify and provide information of any malware like below:

You can optimize the image by using Upload::optimizeImage() method. Optimization is provided in 3 levels (excellent, moderate and average).

You can resize the image by using Upload::resize() method. The resize() method accepts 4 parameters: width, height, file and preserve_aspect_ratio (optional)

or

File storage is possible through Upload::store() method. store() accepts 3 parameters: file, disk_name, path (optional)

or

Chunk file upload functionlaity is provided. You can use Upload::receiveChunks() method to receive chunks and its metadata. You can pass the $request instance into the method. The function will automatically recieve the metadata and each chunks and combine the chunks into a new file when all chunks are received.

The first Http POST request should contain the metadata and then the chunks should be send. The metadata should contain the data as shown below.

You can check upload status and store the file like below.

We also provide two methods for getting the last uploaded chunk and upload progress in percentage.


All versions of file-upload with dependencies

PHP Build Version
Package Version
Requires intervention/image Version ^2.7
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 sar-cubet/file-upload contains the following files

Loading the files please wait ....