Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

567
Views
I can' upload file on my shared folder using laravel

I have a laravel project that i hosted on a shared host. using the system i saw on Laravel Deploy Instruction

So am suppose to upload image, -- user's image. To the public_html folder but since am not in the public_html so the users can't upload their image. since my code lie out side the public_html folder and it doesn't allow write permission for general users. so i tried uploading it to 'storage folder' (ie the my laravel project folder, that is in the sane level as the www 'public_html' folder.) it works i can see the image in the storage folder but i cant access because it is behind the public_html folder. and whatever can't be point to. Example project/storage/app/public is the folder that has the user image if i point to it in <img src="project/storage/app/public/user.png" > it wont display because the browser looks for project/storage/app/public inside the public_html folder whereas it is outside the public_html. So can someone touch on this. Thanks guys. Or is htaccess use in this case?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

you need to create symlink to Your storage folder .

please see this answer:

Laravel 5 - How to access image uploaded in storage within View?

over 4 years ago · Santiago Trujillo Report

0

the above method given by the link works for offline however not all shared hosting site support artisan Laravel sysmlink. so the absolute and best way to do this is with php symlink() function From PHP MANUAL

so just add this code to your web.php ie project\route\web.php

Route::get('/symlink', function()
{
    if(symlink('/home/username/projectfolder/storage/app/public', '/home/username/public_html/storage')){
    echo "We rock yea stackoverflow!!!! best programming software";}
});

so the username is the name of your home dir

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!