camera.uploadFile
অ্যাপটি ক্যামেরা থেকে সরাসরি সার্ভারে একটি ছবি বা ভিডিও আপলোড করার জন্য ক্যামেরায় এই কমান্ডটি জারি করে। একটি HTTP POST অনুরোধ তৈরি করতে ক্যামেরার অন্তর্ভুক্ত প্যারামিটার ব্যবহার করা উচিত। আপলোড করার জন্য ফাইলটি ফাইল fileUrl
দ্বারা নির্দিষ্ট করা হয়েছে এবং এটি accessToken
দ্বারা নির্দিষ্ট করা সঠিক অনুমোদনের সাথে uploadUrl
আপলোড করা উচিত। এই কমান্ডটি API স্তর 2.1 এ যোগ করা হয়েছে এবং সরাসরি আপলোডের সাথে প্রাসঙ্গিক
কেউ একটি কম্পিউটার কমান্ড লাইন থেকে এটি করতে পারে:
curl -X post -H "Authorization: Bearer accessToken" -T fileUrl uploadUrl
পরামিতি
-
fileUrl:
সার্ভারে আপলোড করা ফাইলের URL। -
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." } } |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2024-11-08 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2024-11-08 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["This command, available in API level 2.1 and later, allows apps to instruct the camera to directly upload images or videos to a server."],["The camera uses provided parameters (`fileUrl`, `uploadUrl`, `accessToken`) to form and send an HTTP POST request to the specified server."],["Direct Upload requires obtaining an access token and providing the file's URL and the server's upload URL within the command parameters."],["While the command itself returns no result, potential errors during the upload process can be indicated by specific error codes like `uploadError` or `invalidParameterValue`."]]],["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"]]