提供意見
camera.uploadFile
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
應用程式會向相機發出這個指令,以便將圖片或影片直接從相機上傳到伺服器。相機應使用內含的參數來建立 HTTP POST 要求。要上傳的檔案由 fileUrl
指定,且必須上傳至 uploadUrl
,獲得 accessToken
指定的正確授權。這個指令在 API 級別 2.1 版中新增,與直接上傳 相關
您可以透過電腦指令列執行這項作業,例如:
curl -X post -H "Authorization: Bearer accessToken" -T fileUrl uploadUrl
參數
fileUrl:
要上傳到伺服器的檔案網址。
uploadUrl:
字串,代表上傳檔案的位置。
accessToken:
包含上傳驗證資訊的權杖。由應用程式取得並傳送至相機。
結果
錯誤
missingParameter:
缺少部分參數,例如 fileUrl
。
invalidParameterName:
無法辨識一或多個輸入參數名稱。
invalidParameterValue:
可識別輸入參數名稱,但一或多個傳遞值無效。例如,fileUrl
指定的檔案不存在。
uploadError:
無法上傳相機。
指令 I/O
指令輸入
{ "parameters": { "fileUrl": "URL of the file.", "uploadUrl": "A string representing where to upload the file.", "accessToken": "A token containing the authentication information." } }
指令輸出
none
指令輸出 (錯誤)
{ "error": { "code": "uploadError", "message": "Camera failed to upload the file." } }
提供意見
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權 ,程式碼範例則為阿帕契 2.0 授權 。詳情請參閱《Google Developers 網站政策 》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2022-09-26 (世界標準時間)。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
想進一步說明嗎?