1
mirror of https://github.com/rclone/rclone synced 2024-12-26 18:23:45 +01:00

drive: Add "Forbidden to download" message for files with no downloadURL - fixes #95

This commit is contained in:
Nick Craig-Wood 2015-08-16 14:11:21 +01:00
parent e2f4d7b5e3
commit 88ea8b305d

View File

@ -962,6 +962,9 @@ func (o *FsObjectDrive) Storable() bool {
// Open an object for read
func (o *FsObjectDrive) Open() (in io.ReadCloser, err error) {
if o.url == "" {
return nil, fmt.Errorf("Forbidden to download - check sharing permission")
}
req, err := http.NewRequest("GET", o.url, nil)
if err != nil {
return nil, err