Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
camera.uploadFile
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アプリはこのコマンドをカメラに発行して、画像のアップロードを開始します。
カメラからサーバーに直接送信できます。カメラは付属の
HTTP POST リクエストを形成します。アップロードするファイルは
fileUrl です。正しいファイルを使用して uploadUrl にアップロードする必要があります。
accessToken で指定された認証。このコマンドは API レベルで追加されました。
2.1 で、これは
直接アップロード
これは、次のようにパソコンのコマンドラインから行うことができます。
curl -X post -H "Authorization: Bearer accessToken" -T fileUrl uploadUrl
パラメータ
fileUrl:: サーバーにアップロードするファイルの URL。
uploadUrl:: ファイルのアップロード先を表す文字列。
accessToken:: 認証情報を含むトークン。
選択します。この情報はアプリによって取得され、カメラに送信されます。
結果
エラー
missingParameter: 一部のパラメータ(fileUrl など)がありません。
invalidParameterName: 1 つ以上の入力パラメータ名が
認識されません。
invalidParameterValue: 入力パラメータ名が認識される
無効な値が 1 つ以上渡されました。たとえば、
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." } } |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-08-21 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2024-08-21 UTC。"],[],["The app directs the camera to upload a file to a server using an HTTP POST request. Key parameters include `fileUrl` (the file's location), `uploadUrl` (the destination), and `accessToken` (authorization token). The camera utilizes these parameters to perform the upload. No direct result is returned upon command execution, but error messages such as `missingParameter`, `invalidParameterValue` or `uploadError` will be returned if the command is not correctly executed. This feature was introduced in API level 2.1.\n"]]