lundi 6 mai 2019

Images doesn't upload in the correct location in Laravel

I have an image upload form in my Laravel project.

I want to save the upload image into public/images/ location.

But image upload into public/app/images location.

From where this app coming !!

config/filesystem.php

'disks' => [

 'local' => [
    'driver' => 'local',
    'root' => public_path(''),
],

'public' => [
    'driver' => 'local',
    'root' => public_path(''),
    'visibility' => 'public',
],

's3' => [
    'driver' => 's3',
    'key' => 'your-key',
    'secret' => 'your-secret',
    'region' => 'your-region',
    'bucket' => 'your-bucket',
],

],

controller

if($this->request->hasFile('photo')) 
{
    $image_url = $this->request->photo->store('/images/campaign/large');

    $image = substr($image_url, strrpos($image_url, '/') + 1);
}

I have apply the same code in my local project. Image uploaded there in the correct location.

But this problem happen in my cPanel server project. I have already clear cash in live server.

Where is the mistake ? Anybody help please?

Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire