Statistics
24
2
0
2d
Badges
Dependencies

Dropzone Uploader

Dropzone Uploader for Nette Framework and DropzoneJs.

Build Status Coverage Status

Installation

The best way to install AlesWita/WebLoader is using Composer:

# For PHP 7.1, Nette Framework 2.4/3.0 and DropzoneJs 5
$ composer require aleswita/dropzoneuploader:~1.0

Usage

Config

extensions:
	webloader: AlesWita\DropzoneUploader\Extension

dropzoneuploader:
	dropzoneTemplate: ::constant(AlesWita\DropzoneUploader\Factory::BOOTSTRAP_V4_TEMPLATE)
	uploadDriver:
		driver: AlesWita\DropzoneUploader\UploadDriver\Ftp
		settings:
			url: ftp://user:password@my-ftp.cz
	settings:
		maxFilesize: 1mb
		acceptedFiles:
			- application/vnd.ms-excel
			- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
		addRemoveLinks: TRUE
	messages:
		dictDefaultMessage: "Drag & drop files!"

Presenter

use AlesWita;


final class DropzonePresenter extends Nette\Application\UI\Presenter
{
	/** @var AlesWita\DropzoneUploader\Factory @inject */
	public $dropzoneFactory;

	...
	...

	/**
	 * @return AlesWita\DropzoneUploader\DropzoneUploader
	 */
	protected function createComponentDropzoneForm(): AlesWita\DropzoneUploader\DropzoneUploader {
		$uploader = $this->dropzoneFactory->getDropzoneUploader();

		$uploader->onBeginning[] = function (AlesWita\DropzoneUploader\DropzoneUploader $uploader): void {
			$uploader->setFolder("foo");
		};

		return $uploader;
	}
}

Template

{control dropzoneForm}
  • 1.3 Version 1.3

    • bug fix, when set maxFilesize and not set acceptedFiles
    • compatibility with Bootstrap v4.0.0-beta
    • Bootstrap v4 template improvments
  • 1.2 Version 1.2

    • nette coding standard
    • bug fix, when download file over FtpDriver on OSX
  • 1.1 Version 1.1

    • support for download the uploaded files
    • fixed bug, when Move driver load uploaded files
  • 1.0 Version 1.0

    For Nette Framework: ~2.4.0 || ~3.0.0
    For PHP: ~7.1

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com