davy_yg

The file system is to address the file path right?

'root' => public_path() . '/images/foto_ktp',

and

'root' => public_path() . '/images/foto_profile',

jlrdw
jlrdw
6 months ago (252,680 XP)

This is a last attempt only:

<?php echo storage_path() . '/' . 'upload/';    ?>

echo out that and see what you get, then it will be clear.

SO

<?= storage_path() . '/' . 'where_ever_I_want_images/a_image_subfolder';    ?>
davy_yg

It shows :

"C:\xampp\htdocs\shopee_lvl\public/images/"

Is that the correct path syntax ? The location is correct.

Where to put the path location? 'foto_ktp' is the path correct?

$request->file('foto_ktp')->storeAs(null, $original_name_ktp, 'foto_ktp');      

and it should be taking the path from:

'foto_ktp' => [
          'driver' => 'local',
           'root' => public_path() . '/images/foto_ktp',
          'url' => env('APP_URL').'/images/foto_ktp',
        'visibility' => 'public',
    ],

correct?

jlrdw
jlrdw
6 months ago (252,680 XP)

In xampp, set up your development correctly following this guide

http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

Should look like this https://imgur.com/Oo6k4Fp

Then choose if you want images above public_html(htdocs) or under public_html

It's just good to setup dev env correctly instead of all in one folder under htdocs.

In laravel most store images under storage which is above htdocs. But choice is yours, you can also store in public folder, if non-secure and okay for public to gain access to.

I feel you would benefit from a proper laravel folder structure prior to anything else.

Please sign in or create an account to participate in this conversation.