Developed with love by KnpLabs Hire us for your project!
279

VichUploaderBundle

by dustin10

A simple Symfony2 bundle to ease file uploads with ORM entities and ODM documents.

VichUploaderBundle

Build Status

The VichUploaderBundle is a Symfony2 bundle that attempts to ease file
uploads that are attached to ORM entities or ODM documents.

  • Automatically name and save a file to a configured directory
  • Inject the file back into the entity or document when it is loaded from the datastore as an instance of Symfony\Component\HttpFoundation\File\File
  • Delete the file from the file system upon removal of the entity or document from the datastore
  • Templating helpers to generate public URLs to the file

All of this functionality is fully configurable to allow for app-specific customization.

Current limitations:

  • Saving/deleting files to the local filesystem only

Documentation

For usage documentation, see:

Resources/doc/index.md

If upgrading from a previous version, also check:

UPGRADE.md

For license, see:

Resources/meta/LICENSE

Copyright (c) 2011 Dustin Dobervich

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
vich_uploader:
db_driver: ~ # Required
storage: vich_uploader.storage.file_system
twig: true
gaufrette: false
mappings:

# Prototype
id:
uri_prefix: /uploads
upload_destination: ~ # Required
namer: ~
directory_namer: ~
delete_on_remove: true
delete_on_update: true
inject_on_load: true
  • Merge pull request #114 from roverwolf/patch-1
    By ftassi, 1 hour ago
  • Update PHPDoc
    By ftassi, 3 hours ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Merge branch 'namer' of git://github.com/ivan1986/VichUploaderBundle into ivan1986-namer
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • Improve namers documentation
    By ftassi, 1 day ago
  • add doc for namer
    By ivan1986, 1 day ago
  • fix test
    By ivan1986, 1 day ago
  • Add namer whis add uniqid to original file name
    By ivan1986, 1 day ago
  • Merge pull request #135 from ivan1986/patch-1
    By ftassi, 1 day ago
  • fix composer - symfony/doctrine-bundle to doctrine/doctrine-bundle
    By ivan1986, 1 day ago
  • Merge pull request #135 from ivan1986/patch-1
    By ftassi, 1 day ago
  • Merge pull request #135 from ivan1986/patch-1
    By ftassi, 1 day ago
  • Merge pull request #135 from ivan1986/patch-1
    By ftassi, 1 day ago
  • Merge pull request #135 from ivan1986/patch-1
    By ftassi, 1 day ago
  • Merge pull request #135 from ivan1986/patch-1
    By ftassi, 1 day ago
  • Avoids static data provider in #116
    By ftassi, 2 days ago
  • Merge branch 'uniqid-namer' of git://github.com/EmmanuelVella/VichUploaderBundle into EmmanuelVella-uniqid-namer
    By ftassi, 2 days ago