0

I'm moving my project to homestead and I got strange behavior when it comes to uploading files. Previously when working no on homestead it worked fine.

Code which is responsible for uploading files:

$path = $request->file('result')->store('results');
$fileContent = Storage::get($path);

So it should just store a file under results folder.

What actually happens:

  1. For some reason the permissions on the results folder become 755 even though I set them to 777 before

  2. I got an error when uploading file: fopen(/home/vagrant/Sites/pft/api/storage/app/results/9g1tx5bDuMU2XBtfhXqDrQ9VT1m6dZJJa84Sqgyx.txt): failed to open stream: Protocol error

Victor
  • 5,073
  • 15
  • 68
  • 120
  • This should help you: http://stackoverflow.com/questions/24055056/laravel-log-could-not-be-opened-failed-to-open-stream – Troyer May 21 '17 at 20:57
  • Actually I couldn't even change folder owner to www-data: sudo chown -R yourusername:www-data storage didn't change it, I got vagrant/vagrant owner – Victor May 21 '17 at 21:14
  • Oops, actually I should set permissions from my mac, not homestead – Victor May 21 '17 at 21:18

0 Answers0