ivanvermeyen / laravel-google-drive-demo

Laravel & Google Drive Storage - Demo project with Laravel 5.4
403 stars 155 forks source link

Upload directly to drive folder #74

Closed felix2056 closed 4 years ago

felix2056 commented 4 years ago

I know this issue has already been fixed but I can't seem to get it to work for me as I am new to Laravel.

I already set a folder ID in my env file and i have sub folders inside as well. Now I want to select any sub folder and upload a file directly to Google disk with custom file name.

Please can you write a simple code snippet that would work?

ivanvermeyen commented 4 years ago

Hello,

This commit has 2 routes. One to create a directory and one to create a file in that directory.

The thing to remember is that Google always requires the unique ID's (paths) instead of the human readable name in order to find an existing directory or file. The reason for this is that Google allows duplicate directory/file names.

I hope this helps 👍