2017 © Pedro Peláez
 

symfony-bundle uploadbundle

A upload bundle for duguncom and anneysencom

image

duguncom/uploadbundle

A upload bundle for duguncom and anneysencom

  • Thursday, April 26, 2018
  • by muminaydin
  • Repository
  • 4 Watchers
  • 1 Stars
  • 7,519 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

Installation

1: Download the Bundle

You can add duguncom/uploadbundle to your requirements with dev-master, (*1)

"duguncom/uploadbundle": "~2.0",

or you can directly run:, (*2)

composer require duguncom/uploadbundle

2: Enable Bundle

Add bundle to your registered bundles list in the app/AppKernel.php:, (*3)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Dugun\UploadBundle\DugunUploadBundle(),
        );

        // ...
    }

    // ...
}

3: Configuration

Add our needed configuration parameters to your app/config/config.yml, (*4)

dugun_upload:
    upload_service_name: %dugun_upload.upload_service_name% # choose your side
    temporary_path: %dugun_upload.temporary_path% # give a folder path that web-server has access to write (maybe /tmp is good)
    credentials:
        aws:
            base_url: %dugun_upload.credentials.aws.base_url%
            bucket: %dugun_upload.credentials.aws.bucket%
            version: latest
            region: %dugun_upload.credentials.aws.region%
            scheme: http
            credentials:
                key: %dugun_upload.credentials.aws.credentials.key%
                secret: %dugun_upload.credentials.aws.credentials.secret%

4: Usage

You can use upload_service on your controllers by getting from container or you can pass service to your other services., (*5)

Service naming: dugun_upload.service.dugun_upload

Uploading File

$file = 'It can be path of a file';
$file = 'OR It can be UploadedFile instance';
$file = 'OR It can be \Intervention\Image\Image instance';
$destinationPath = '/uploaded/folder/filename.jpg';
$result = $this->uploadService->upload($file, $destinationPath);
//If file uploaded successfully, $result['success'] returns as (boolean)true
//And if its true, it returns $result['file_url'] that you can access your file

The Versions

26/04 2018
26/04 2018

dev-upgrade/symfony-4

dev-upgrade/symfony-4

A upload bundle for duguncom and anneysencom

  Sources   Download

MIT

The Requires

 

The Development Requires

by salah aldin alsasa

upload bundle

24/11 2016
29/06 2016

dev-version1

dev-version1

A upload bundle for duguncom

  Sources   Download

MIT

The Requires

 

The Development Requires

by salah aldin alsasa

upload bundle

16/05 2016

1.1.1

1.1.1.0

A upload bundle for duguncom

  Sources   Download

MIT

The Requires

 

The Development Requires

by salah aldin alsasa

upload bundle

18/03 2016
29/02 2016
29/01 2016

1.0

1.0.0.0

A upload bundle for duguncom

  Sources   Download

The Requires

 

The Development Requires

by salah aldin alsasa

upload bundle