PHPackages                             oval/laravel-upload-helper - 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. oval/laravel-upload-helper

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

oval/laravel-upload-helper
==========================

Upload helper library for Laravel

v1.0.3(11y ago)3550MITPHPPHP &gt;=5.3.0

Since Nov 12Pushed 11y ago3 watchersCompare

[ Source](https://github.com/jamestrusleroval/PHP_Laravel_Upload_Helper)[ Packagist](https://packagist.org/packages/oval/laravel-upload-helper)[ Docs](https://github.com/jamestrusleroval/PHP_Laravel_Upload_Helper)[ RSS](/packages/oval-laravel-upload-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

PHP\_Laravel\_Upload\_Helper
============================

[](#php_laravel_upload_helper)

Include our library using the composer name: "oval/laravel-upload-helper": "v1.0.3"

**Controller:**

Here is an example of a controller method

```
public function PostTestUpload()
{
    $file = Input::file( "File" );

    // Check if any file was uploaded
    if( Input::hasFile( "File" ) )
    {
        $validation = Validator::make(
            array( "File" => $file ), // Values
            array( "File" => "mimes:png" ) // Rules
        );

        if( !$validation->fails() )
        {
            UploadHelper::UploadFile( $file, "location/of/file", uniqid() . "_" . $file->getClientOriginalName() );
        }
        else
        {
            print_r( $validation->messages() );
        }
    }
    else
    {
        // Redirect with some error saying upload a file!
        echo "Ah, no file was uploaded...";
    }
}

```

**View:**

Here is an example of the view

```
