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

VichUploaderBundle

by dustin10

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

VichUploaderBundle

Build Status Total Downloads Latest Unstable Version

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

  • 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.

Documentation

For usage documentation, see:

Resources/doc/index.md

If upgrading from a previous version, also check:

UPGRADE.md

Contributing

See the CONTRIBUTING file.

License

See the bundled LICENSE file.

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:
default_filename_attribute_suffix: _name
db_driver: ~ # Required
storage: file_system
twig: true
metadata:
cache: file
file_cache:
dir: %kernel.cache_dir%/vich_uploader
auto_detection: true
directories:
path: ~ # Required
namespace_prefix:
mappings:

# Prototype
id:
uri_prefix: /uploads
upload_destination: ~ # Required
namer: ~
directory_namer: ~
delete_on_remove: true
delete_on_update: true
inject_on_load: false
db_driver: ~
  • Add a note about UploadedFile test mode
    By K-Phoen, 1 year ago
  • Merge pull request #395 from meron1122/fix-duplicate
    By K-Phoen, 1 year ago
  • Merge pull request #396 from meron1122/polish-translate
    By K-Phoen, 1 year ago
  • Add polish translation
    By , 1 year ago
  • Fix Duplicate label Bug
    By meron1122, 1 year ago
  • Merge pull request #387 from bocharsky-bw/patch-2
    By K-Phoen, 1 year ago
  • Replace deprecated form.resources with form_themes key
    By bocharsky-bw, 1 year ago
  • Merge pull request #388 from bocharsky-bw/patch-1
    By K-Phoen, 1 year ago
  • Translate to "uk" locale
    By bocharsky-bw, 1 year ago
  • Translate to "ru" locale
    By bocharsky-bw, 1 year ago
  • Merge pull request #386 from bocharsky-bw/patch-1
    By K-Phoen, 1 year ago
  • Fix error with annotation using Doctrine ORM
    By bocharsky-bw, 1 year ago
  • Merge pull request #374 from gnat42/patch-1
    By K-Phoen, 1 year ago
  • Remove an unused parameter
    By gnat42, 2 years ago
  • Fix docblock
    By K-Phoen, 2 years ago
  • Fix UploadHandler::hasUploadedFile check
    By K-Phoen, 2 years ago
  • Allow the Storage::resolvePath method to return relative paths
    By K-Phoen, 2 years ago
  • Define a few services as private
    By K-Phoen, 2 years ago
  • Add a DownloadHandler to ease file downloads from non web-accessible locations
    By K-Phoen, 2 years ago
  • Handle inheritance in MetadataReader::getUploadableFields
    By K-Phoen, 2 years ago
  • Fix circular dependency when using gaufrette doctrine storage and doctrine ORM (Fixes #370)
    By K-Phoen, 2 years ago
  • Fix tests for symfony 2.7.x-dev
    By K-Phoen, 2 years ago
  • Test both vich_file and vich_image in functional tests
    By K-Phoen, 2 years ago
  • Removed unused methods in UploadableField
    By K-Phoen, 2 years ago
  • Update tests for the UploadHandler
    By K-Phoen, 2 years ago
  • Avoid triggering the remove events if there is nothing to remove
    By K-Phoen, 2 years ago
  • Merge pull request #363 from ldaguise/master
    By K-Phoen, 2 years ago
  • fix doc typo
    By , 2 years ago
  • Remove useless check in YamlDriver
    By K-Phoen, 2 years ago
  • Add a test for ClassMetadata serialization
    By K-Phoen, 2 years ago