0

I have uploaded a laravel project in cPanel.

public folder of my project is uploaded inside public_html of cPanel. Other folders are uploaded in the root folder of cPanel.

Now Those images which are shown are uploaded while I run the project locally and those images are now inside the public_html/storage/ in cPanel.

When I am uploading another images in my project from cPanel those are uploaded inside the root folder myProjectName/storage/app/public

Here is the picture

enter image description here

Here is the red mark image is not shown and this image I have added after uploading the project in cPanel.

Any body help please?

raff
  • 423
  • 4
  • 13
  • 28
  • Why do you understand this? Most of us won't because there is so little information you supply. Take a look at the source-code and the web inspector, what do they say? – Tom Mar 06 '18 at 10:42
  • What is the current path vs. what's the path meant to be? – Andy Holmes Mar 06 '18 at 10:43
  • @Andy Holmes.......url.com/storage/myFile.jpg....path means image src... – raff Mar 06 '18 at 10:52
  • @Tom Lankhorst...What you won't understand ? Please ask if any query – raff Mar 06 '18 at 10:54
  • @raff I'm aware of what a path is, I'm asking you what is the current path of the image that isn't loading, and what is the path that it should be? – Andy Holmes Mar 06 '18 at 11:04
  • @AndyHolmes...current image is `url.com/storage/myFile.jpg`...It sould be `url.com/../../admin_panel/storage/app/public/myFile.jpg – raff Mar 06 '18 at 11:07
  • Can you add the code of how you want to retreive / display the image? You lack information in your question. – killstreet Mar 06 '18 at 11:09
  • @killstreet ... I have updated my post...please check – raff Mar 06 '18 at 11:36
  • I'm sorry but even this information is not enough for proper help. First of: You say you only uploaded the public folder inside public_html? Unless your using virtualhost files, this will not work. Second, there is yet no code of how you retreive your files, and what result they have along with what it should be. Please add this so we can help you properly. – killstreet Mar 06 '18 at 11:43
  • We're going to need to see some code to help you out properly. Thanks for clarifying the 2 paths but it's not helpful at the minute – Andy Holmes Mar 06 '18 at 12:08
  • @Andy Holmes... I am very much sorry for not properly clarifying... I can't explain exactly what i want... :( – raff Mar 06 '18 at 12:11
  • I understand what you want, but we need to see the code you're using to retrieve the image – Andy Holmes Mar 06 '18 at 12:12
  • @Andy Holmes.........will you please look at this post [https://stackoverflow.com/questions/49145262/error-missing-storage-symlink-for-voyager-admin-panel-in-cpanel] – raff Mar 07 '18 at 06:24

2 Answers2

1

if use laravel storage to uploaded run below in terminal

php artisan storage:link

take care what is directory permission !!!and in sever file uploaded or not. if uploaded where is uploaded?

Mahdi Bahari
  • 109
  • 1
  • 10
0

To clearify some stuff, the other answer by @Mahdi Bahari would be correct. When files are stored outside your laravel project you must do a

php artisan storage:link

If however you are unable to get shell access with your host, then you should probably not upload images outside the laravel project. My first recommendation would be using laravel's storage folder. Which is what laravel uses to store folders / images for the project. Laravel file storage

killstreet
  • 1,251
  • 2
  • 15
  • 37