3
votes

I have an image upload in my Laravel application and would like to have those images uploaded to shared network drive located on external Windows computer.

Is it somehow possible to mount a spesific folder at my shared network drive as Laravel Storage? Laravel 5.4's manual says that there is only s3 and Rackspace included as build-in drivers.

Thanks in advance.

2
Laravel uses flysystem, so you have its api to develop storage drivers that suit your needs, like github.com/spatie/flysystem-dropboxAsur

2 Answers

1
votes

I had a similar requirement and solved it by mounting the network share to a folder (or you could mount to a drive) in the local file system. There are plenty of guides on the net for doing this depending on your server operating system. You can then use the "local" file system driver to access the files.

Note that this means some sort of script on the server needs to handle connecting with the credentials required, rather than the laravel application, which may/may not be suitable in your environment.

-4
votes

You can use different drive to store your upload media. For example if you want to use googleDrive as your storage drive just need to follow below steps:

1) Pull filesystem adepter for google drive
2) Setup config/filesystem.php
3) Setup service provider

Setup .env with client ID and authentication stuffs and done.

You can check the detail about how to setup GDrive by this example code.