PHPackages                             south634/mass-media-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. south634/mass-media-bundle

ActiveSymfony-bundle[File &amp; Storage](/categories/file-storage)

south634/mass-media-bundle
==========================

File path management bundle for Symfony

015PHP

Since Feb 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/south634/MassMediaBundle)[ Packagist](https://packagist.org/packages/south634/mass-media-bundle)[ RSS](/packages/south634-mass-media-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

MassMediaBundle
===============

[](#massmediabundle)

A Symfony bundle for creating hashed filenames from uploaded files, and spreading them out across directories.

You can set the hashing algorithm you want to use to create filenames, how many folders deep you want the files to be stored, and how many characters to use per folder name. It uses the leading characters in the hashed filename to create the folder names.

For example, given `sha1` as your hashing algo, you might get a filename like this:

`3882be53dbfc4a0a4305fba989d224b863fe8cfd.jpg`

If you set folder character length: 2, and folder depth: 2, that file would be stored here:

`/38/82/3882be53dbfc4a0a4305fba989d224b863fe8cfd.jpg`

Setting folder character length: 3, and folder depth: 1, would store the file here:

`/388/3882be53dbfc4a0a4305fba989d224b863fe8cfd.jpg`

This functionality may be useful for those that do not want to have too many files residing in any single directory.

Installation
============

[](#installation)

Step 1: Download the Bundle
---------------------------

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command:

```
$ composer require south634/mass-media-bundle "dev-master"
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

Step 2: Enable the Bundle
-------------------------

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `app/AppKernel.php` file of your project:

```
