सुझाव भेजें
नोट और अटैचमेंट वापस पाना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
नीचे दिए गए उदाहरण में, नोट और उसके अटैचमेंट को वापस पाने का तरीका बताया गया है:
आराम media.download()
को इस
अटैचमेंट डाउनलोड का नाम और alt=media
यूआरएल पैरामीटर. कॉन्टेंट बनाने
alt=media
यूआरएल पैरामीटर से सर्वर को पता चलता है कि कॉन्टेंट डाउनलोड किया गया है
किया जा रहा है.
अटैचमेंट का नाम पाने के लिए, आपको पहले नोट वापस पाना होगा.
ध्यान दें: alt=media
यूआरएल पैरामीटर
सिस्टम पैरामीटर
यह सुविधा, Google REST के सभी एपीआई पर उपलब्ध है. अगर आप
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 );
// A second call is required in order 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 एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-08-20 (UTC) को अपडेट किया गया.
[{
"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":"अन्य"
}]
क्या आपको हमें और कुछ बताना है?
{
"last_modified": "आखिरी बार 2024-08-20 (UTC) को अपडेट किया गया.",
"state": ""
}