Getting the download link for a public Google Docs file

可紊 提交于 2020-01-22 09:53:30

问题


Reading the Google Docs API I find this:

Downloading

Files cannot be downloaded in a format other than the one in which they were originally uploaded. The download URL for files looks something like this:

https://doc-04-20-docs.googleusercontent.com/docs/secure/m7an0emtau/WJm12345/YzI2Y2ExYWVm?h=16655626&e=download&gd=true

Given a public Google Documents file URL, say,

https://docs.google.com/open?id=0B1-vl-dPgKm_NTNhZjZkMWMtZjQxOS00MGE1LTg2MjItNGVjYzdmZjYxNmQ5

How can I turn it into a download link?


回答1:


Hi nightcracker try this:

https://docs.google.com/uc?export=download&id=DOCIDGOESHERE

I've only tried it with one pdf and it worked ok so maybe having a play with that will help....

All the best,

Dave




回答2:


For a published document, the method suggested by dkcwd did not worked.

I have found the following method in this page. Given a publish document URL, such as

https://docs.google.com/document/pub?id=[ID]

The download link is

https://docs.google.com/document/export?format=[FORMAT]&id=[ID]

where [FORMAT] can have one of these values: pdf, doc, docx, oo, rtf, txt.



来源:https://stackoverflow.com/questions/9045392/getting-the-download-link-for-a-public-google-docs-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!