drive
drive copied to clipboard
"drive share --with-link" does not return a URL, but throws a "googleapi: Error 400: Permission value field required" although the file is correctly shared.
file="Proposal for a DNS Secured BGP.pdf"
drive share --with-link -no-prompt -verbose "$file" 2>&1
successful share for Proposal for a DNS Secured BGP.pdf with email "", role "reader" accountType "anyone"
share err Proposal for a DNS Secured BGP.pdf: googleapi: Error 400: Permission value field required, required
On Google Drive:
Publishing works as expected, for the same file:
drive pub -hidden "$file" 2>&1
/Missions/Innovations/Proposal for a DNS Secured BGP.pdf published on https://drive.google.com/open?id=0B6XxNd5c3zV_LWNKZmxUSGVZZDA
Ubuntu 16.10 4.8 drive version couldn't be any fresher:
drive version: 0.3.8.1
Commit Hash: 'fa3d326f72ae91399b2aa607c79293fb8a293b96'
Go Version: go1.7.1
OS: linux/amd64
BuildTime: 2016-12-24 06:22:04.78836032 +0100 CET
I stumbled upon this scenario too.
The command drive share --with-link MYFILE
does get the file sharing property correctly changed.
The issue is that it does not return the sharing link but the 400 error instead. Apparently there is no command for getting the sharing link either. Although one could always run drive file-id MYFILE
afterwards and construct the sharing link.
@drupalista-br Yes, you're right, nice workaround :-)
I'll add my one-liner to get the link:
echo 'https://drive.google.com/open?id='"$(drive id MYFILE | awk -v RS="" -F\" '{print $3}')"
And ask if there's any perspective of getting this fixed?
@odeke-em seems to have dropped the ball.