Download the PHP package vkr/symfony-web-uploader without Composer

On this page you can find all versions of the php package vkr/symfony-web-uploader. 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 symfony-web-uploader

About

This small library (not a bundle!) simplifies uploading files to an external resource via an API. Since version 1.2, this library depends on Symfony.

This library does not do anything by itself, it is designed to be extended by other bundles or libraries.

Installation

Nothing to install here, really.

Usage

In Symfony projects

First, you need to create a concrete service implementation of class. This service needs to have a single method called that does not accept arguments and by convention should return .

Here are the properties that can be accessed from inside that method:

If you register this service inside Symfony service container, you will need to install VKRSettingsBundle and add it as an argument to :

Then, you will need to create three settings either as parameters or inside your DB:

See VKRSettingsBundle manual on how settings can be defined.

Here is how you access this service from your controller:

Here checks if the uploaded file exists, has same size and MIME type as the original file and throws exception on error.

If you want to disable checks for size and MIME type, you can call:

Name changers

The second argument to is a name changer object. It defines what name will the new file have. If no name changer is present, the new file will have the same name as the original. Name changers must implement .

Suppose that you want all files to be renamed with current Unix timestamps, in this case your name changer will look like this:

Then in your controller:

You do not need to create a name changer if your file was just uploaded by a client and you want to keep the client filename in this case the default new name will correspond to the client filename, not to the PHP temporary name.

Outside of Symfony

Things are not that different outside of Symfony, however you cannot use VKRSettingsBundle and must pass your settings as an array:

Also, if you are forwarding a file that was just uploaded from a form, you need to initialize it manually:


All versions of symfony-web-uploader with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
symfony/http-foundation Version ~2.8|~3.0
vkr/settings-bundle Version ~1.1
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 vkr/symfony-web-uploader contains the following files

Loading the files please wait ....