Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/intaro/file-uploader-bundle
Simplifies file uploading in Symfony2
https://github.com/intaro/file-uploader-bundle
bundle php symfony symfony-bundle
Last synced: 3 months ago
JSON representation
Simplifies file uploading in Symfony2
- Host: GitHub
- URL: https://github.com/intaro/file-uploader-bundle
- Owner: intaro
- License: mit
- Created: 2014-10-20T14:26:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-11T10:53:09.000Z (3 months ago)
- Last Synced: 2024-10-11T11:53:59.222Z (3 months ago)
- Topics: bundle, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 58.6 KB
- Stars: 3
- Watchers: 16
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File Uploader Bundle #
## About ##
This is Symfony2 bundle. The purpose of this bundle is to simplify the file uploading process.
It moves files to storage after they were uploaded into temporary folder.There are few supported storage types:
- local filesystem
- amazon s3## Installation ##
Require the bundle in your composer.json file:
``` json
{
"require": {
"intaro/file-uploader-bundle": "dev-master",
}
}
```Register in AppKernel:
``` php
// app/AppKernel.php
class AppKernel extends SaasKernel
{
public function registerBundles()
{
$bundles = array(
...
new Intaro\FileUploaderBundle\IntaroFileUploaderBundle(),
);
}
}
```
Install with composer:```
$ composer update intaro/file-uploader-bundle
```## Usage ##
In config:
``` yml
# app/config/config.yml
intaro_file_uploader:
uploaders:
local:
image:
path: http://www.app.local/images/
create: true
allowed_types: ['image/jpeg', 'image/png', 'image/gif']
document:
directory: path/to/another/attach/dir
create: true
allowed_types: ['application/pdf', 'application/rtf', 'application/vnd.ms-office']
aws_s3:
video:
service_id: aws.client_service_name
path: https://s3-us-west-2.amazonaws.com/bucket-name/iamges/
bucket_name: some_bucket
options:
create: true
acl: public-read
```
In code:
```php
public function uploadAction()
{
$files = $this->getRequest()->files->get('file');
$this->get('intaro.video_uploader')->upload($file);
}
```