获取Google云端硬盘中文件的公共链接

时间:2020-01-16 07:08:15

标签: android drive

我想编写一个APP,我可以在驱动器上获取文件的下载链接,然后将下载链接发送到另一台设备,以从驱动器中下载该文件。

我使用意图在object(WP_Post)#13185 (24) { ["ID"]=> int(952) ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2020-01-16 16:24:17" ["post_date_gmt"]=> string(19) "2020-01-16 05:24:17" ["post_content"]=> string(0) "" ["post_title"]=> string(6) "AA0AA0" ["post_excerpt"]=> string(0) "" ... (additional fields) } (N.B -- $pet->post_title = AA0AA0) array(56) { ["_edit_last"]=> array(1) { [0]=> string(1) "1" } ["_edit_lock"]=> array(1) { [0]=> string(12) "1579152259:1" } ["pet_details_pet_name"]=> array(1) { [0]=> string(6) "Cooper" } ["_pet_details_pet_name"]=> array(1) { [0]=> string(19) "field_5e1189ab705b2" } ["pet_details_pet_birthday"]=> array(1) { [0]=> string(8) "20130313" } ... (additional fields) } (N.B. $pet_name = Cooper) 中获取文件content uri。 如何将此google drive转换为uri? 然后,我想将此public link发送到public linkanother app,以便另一个应用程序和mp3播放器可以通过公共链接下载文件。

我选择这样的文件:

mp3 player

我认为也许我需要将内容uri转换为Google Drive API中提到的“ fileid”: https://developers.google.com/drive/api/v3/manage-downloads#downloading_a_file 如何获取文件名?

1 个答案:

答案 0 :(得分:0)

我认为这不是技术问题。您只想通过Google驱动器公开文件。如果这是问题,则可以使用this link

注意:请根据需要选择正确的选项以使其公开。

要通过驱动器的Andriod应用执行相同的操作,请使用this链接

enter image description here