4
votes

Ive written a Laravel application where I upload images and pdf files.
Currently In uploading those into a folder within the public directory.

Now I been trying Envoyer.io, where I can easily deploy my projects to the server(s). The problem here is that each project has its own directory. So everytime all those uploads dissapear. Ive figgered out that Envoyer does use a symlink for the storage directory in every deployed project.

I can upload the files to the storage directory, but when I return the URL from the files in de storage pth I receive a path like "/var/www/project/app/storage/file.ext" which is the base path. I dont want to return those links in my API cause of security reasons. I there any way I can upload to the storage path and get those uploads with an more friendly URL? Or does anyone have an ither solution?

1

1 Answers

1
votes

If you use Laravel Storage feature then you do not need to worry about absolute path. You can even save the files in amazon cloud on completely different machine.

Storage works only with file contents and relative paths instead of absolute paths like PHP File. However you cannot mix the Laravel Storage and PHP File logics easily.

Envoyer must keep the storage folder same within one application. If you need to share it with other projects then upload to Amazon or write your own implementation of the Storage Facade.

More info at http://laravel.com/docs/5.0/filesystem