好吧,簡單地說,你需要調查究竟是什麼引起的。獲取CURL,看看發生了什麼事情:
curl -D - -o /dev/null -L "https://docs.google.com/uc?export=download&id=0BwScoO2FIDnQQlF2cHVLbHBjQzg"
,會給你這樣的:
Content-Type: text/html; charset=UTF-8
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Date: Fri, 03 Apr 2015 17:42:47 GMT
Location: https://doc-0c-8k-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/m2vr72uv54vrhd59tvsm5ellda89n0s6/1428076800000/17869486772410674836/*/0BwScoO2FIDnQQlF2cHVLbHBjQzg?e=download
Set-Cookie: NID=67=fxFK6wjqCslAMuLajOnHKWYlkVAJDG6gMzoQnsDZI2wkd5QlP7meP8tDQJEQk9veY0UUOtSZWAjM_JbHAOMcJavkHU2B6-VDUo3jRpBQSm0moWVmN689L-I1vKgGJoVK;Domain=.google.com;Path=/;Expires=Sat, 03-Oct-2015 17:42:47 GMT;HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alternate-Protocol: 443:quic,p=0.5
Accept-Ranges: none
Vary: Accept-Encoding
Transfer-Encoding: chunked
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: false
Access-Control-Allow-Headers: Accept, Accept-Language, Authorization, Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Length, Content-MD5, Content-Range, Content-Type, Date, GData-Version, Host, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, Origin, OriginToken, Pragma, Range, Slug, Transfer-Encoding, X-ClientDetails, X-GData-Client, X-GData-Key, X-Goog-AuthUser, X-Goog-PageId, X-Goog-Encode-Response-If-Executable, X-Goog-Correlation-Id, X-Goog-Request-Info, X-Goog-Experiments, x-goog-iam-role, x-goog-iam-authorization-token, X-Goog-Spatula, X-Goog-Upload-Command, X-Goog-Upload-Content-Disposition, X-Goog-Upload-Content-Length, X-Goog-Upload-Content-Type, X-Goog-Upload-File-Name, X-Goog-Upload-Offset, X-Goog-Upload-Protocol, X-Goog-Visitor-Id, X-HTTP-Method-Override, X-JavaScript-User-Agent, X-Pan-Versionid, X-Origin, X-Referer, X-Upload-Content-Length, X-Upload-Content-Type, X-Use-HTTP-Status-Code-Override, X-YouTube-VVT, X-YouTube-Page-CL, X-YouTube-Page-Timestamp
Access-Control-Allow-Methods: GET,OPTIONS
Content-Type: application/zip
Content-Disposition: attachment;filename="All.zip";filename*=UTF-8''All.zip
Date: Fri, 03 Apr 2015 17:42:47 GMT
Expires: Fri, 03 Apr 2015 17:42:47 GMT
Cache-Control: private, max-age=0
X-Goog-Hash: crc32c=yKvC2Q==
Transfer-Encoding: chunked
Server: UploadServer ("Built on Mar 27 2015 13:04:19 (1427486659)")
Alternate-Protocol: 443:quic,p=0.5
在這裏,你可以看到:
所以,現在你想自動完成這個,也許 - 和this link會幫助你。
快樂學習!
發送HTTP請求並讀取「Content-Disposition」標頭(如果有的話)。 – SLaks 2015-04-02 14:48:25
如果您要與Google雲端硬盤進行互動 - https://developers.google.com/api-client-library/java/apis/drive/v2,則可能必須使用Google Drive API才能完成此操作。 – LittlePanda 2015-04-02 15:25:27