dimanche 28 avril 2019

Images wont upload to public_html folder in Laravel Project

When i try to upload an image to my site, it stores in my storage folder, however, the symlink does not work so it doesnt save it in my public_html folder. I have tried using a custom symlink php file however it does not seem to do anything.

My symlinkcreate.php file

<?php
symlink('/home/jackdeaz/nscraft/storage/app/public', '/home/jackdeaz/public_html/storage');

my Filesystems.php file

'default' => env('FILESYSTEM_DRIVER', 'local'),

'disks' => [

        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
        ],

        'public' => [
            'driver' => 'local',
            'root' => storage_path('app'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
        ],

    ],

This is how i upload an image

$request->file('image_url')->store('public/img/products');

Any help would be greatly appreciated!



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2UHJoxq
via IFTTT

Aucun commentaire:

Enregistrer un commentaire