免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2011年5月4日 星期三

如何上傳.txt 檔案到google Doc?

[Q] How to upload .txt file to google Doc?

[try]
用之前下載的Library,
先試不將 .txt 轉換為 google Doc格式的 uri
http://docs.google.com/feeds/default/private/full?convert=false
失敗, 得到 HTTP 403

只好試  http://docs.google.com/feeds/default/private/full
成功, 得到 HTTP 201


難道 Google Doc 不允許 直接上傳.txt 檔案, 一定要轉成google document ?
可是人工登入google doc , 按下畫面上的 Upload 卻可以成功上傳.txt 檔案,
奇怪?







//=== the request i sent
POST http://docs.google.com/feeds/default/private/full?convert=false HTTP/1.1
Content-Type: text/plain
User-Agent: G-Upload File/GDataGAuthRequestFactory-CS-Version=1.0.0.0
Slug: ps0.txt
Authorization: GoogleLogin
auth=DQAAALMAAAA4JUnuWySTvjArqaoqeKYnB8JbSBdxxxxx-
ExBymsZ6XFxQ2mGZTndmKJCFCG49zY4v9AvosBeZtqA56yumfwVx9bQBi
WWRrfRgakaV2YGRpiwYR0uvyjUEL_KEro9InPnNNyo_qjve1S5UaSjbX7
qG8g66dgfWmpN82P34W2c7Ivv6qio6Bl-NqfxJZOtqcqbM-
LDIzq14lWVOiNb2aB3Kz--nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GData-Version: 3.0
Host: docs.google.com
Content-Length: 926
Expect: 100-continue
Proxy-Connection: Close
.....txt file contents
....

//=== the response i got
HTTP/1.1 403 Forbidden
Content-Type: application/vnd.google.gdata.error+xml
Date: Tue, 03 May 2011 14:10:33 GMT
Expires: Tue, 03 May 2011 14:10:33 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Transfer-Encoding: chunked
db

沒有留言:

張貼留言