Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
सुझाव भेजें
नोट और अटैचमेंट वापस पाना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यहां दिए गए सैंपल में, किसी नोट और उसके अटैचमेंट को वापस पाने का तरीका बताया गया है:
REST अटैचमेंट डाउनलोड के नाम और alt=media यूआरएल पैरामीटर के साथ,
media.download
को कॉल करें.
alt=media यूआरएल पैरामीटर, सर्वर को बताता है कि कॉन्टेंट डाउनलोड करने का अनुरोध किया जा रहा है.
अटैचमेंट का नाम पाने के लिए, आपको पहले नोट वापस पाना होगा .
ध्यान दें: alt=media यूआरएल पैरामीटर, एक
सिस्टम पैरामीटर है. यह Google के सभी REST API में उपलब्ध है. अगर Google Keep API के लिए क्लाइंट लाइब्रेरी का इस्तेमाल किया जाता है, तो आपको इस पैरामीटर को साफ़ तौर पर सेट करने की ज़रूरत नहीं होती.
Java
/**
* Gets and downloads the attachment of a note.
*
* @param note The note whose attachment will be downloaded.
* @throws IOException
*/
private void getNoteAttachment ( Note note ) throws IOException {
// First call is to get the attachment resources on the note.
List<Attachment> attachments =
keepService . notes (). get ( note . getName ()). execute (). getAttachments ();
if ( ! attachments . isEmpty ()) {
Attachment attachment = attachments . get ( 0 );
String mimeType = attachment . getMimeType (). get ( 0 );
// Make a second call to download the attachment with the specified
// mimeType.
OutputStream outputStream =
new FileOutputStream ( "attachmentFile." + mimeType . split ( "/" ) [ 1 ] );
keepService
. media ()
. download ( attachment . getName ())
. setMimeType ( mimeType )
. executeMediaAndDownloadTo ( outputStream );
}
}
सुझाव भेजें
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2026-05-13 (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"]],["आखिरी बार 2026-05-13 (UTC) को अपडेट किया गया."],[],[]]