Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get shareable link of the uploaded file to Google drive using Google drive API v3 in Java

All I wanted to do is: 1)Upload file to Google drive - done 2)Get shareable link of this uploaded file and set its permissions to "Anyone with the link can view" using Google drive Java API v3.

After file upload i tried doing file.getWebViewLink(); but the same is coming as null. Any idea how to do this?

like image 937
AmitB10 Avatar asked Dec 02 '25 20:12

AmitB10


1 Answers

I would recommend you checking the Java Quickstart first and try modifying the code. There's a line there like service.files().list() which you can try to set to service.files().get().setFields("webViewLink"); to fetch the webViewlink property.

like image 199
ReyAnthonyRenacia Avatar answered Dec 05 '25 09:12

ReyAnthonyRenacia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!