php - Google_Http_Request to Google-Drive-API get readable data for response body -
hello making test request google drive via php library provide. request successful , data received not readable humans.
the related document information:
mime type: application/vnd.oasis.opendocument.text after making request via:
$file = $service->files->get($fileid); $downloadurl = $file->getdownloadurl(); if ($downloadurl) { $request = new google_http_request($downloadurl, 'get', null, null); $httprequest = $service->getclient()->getauth()->authenticatedrequest($request); if ($httprequest->getresponsehttpcode() == 200) { return $httprequest->getresponsebody(); } else { // error occurred. return null; } } else { // file doesn't have content stored on drive. return null; } i data of document, gibberish me. :
pk%03%04%14%08%c2%b0bre%5e%c3%862%0c%27%27%08mimetypeapplication%2fvnd.oasis.opendocument.textpk%03%04%14%08%c2%b0bre%18configurations2%2ffloater%2fpk%03%04%14%08%08%08%c2%b0bre%27configurations2%2faccelerator%2fcurrent.xml%03pk%07%08%02pk%03%04%14%08%c2%b0bre%1fconfigurations2%2fimages%2fbitmaps%2fpk%03%04%14%08%c2%b0bre%18configurations2%2fmenubar%2fpk%03%04%14%08%c2%b0bre%1cconfigurations2%2fprogressbar%2fpk%03%04%14%08%c2%b0bre%1aconfigurations2%2fpopupmenu%2fpk%03%04%14%08%c2%b0bre%18configurations2%2ftoolbar%2fpk%03%04%14%08%c2%b0bre%1aconfigurations2%2fstatusbar%2fpk%03%04%14%08%c2%b0bre%1aconfigurations2%2ftoolpanel%2fpk%03%04%14%08%c2%b0bre7%c5%a1%c3%bb%24%e2%80%9e!%e2%80%9e!%18thumbnails%2fthumbnail.png%e2%80%b0png%20%1a%20ihdr%c3%86%01%08%02g%3f%c5%be%17!kidatx%c5%93%c3%ad%5d9%e2%80%99%c3%a2l%13%c3%8d%c5%bd%c3%b8%c2%8f%e2%80%9ad(8%c3%81p%02%c2%81%c6%92%e2%80%a6%c3%9b%1e%cb%9c%c3%82i%0fs%1e%0e%cb%9c%c3%a0%c2%b5%e2%80%b9%e2%80%a6%03%c5%93%40%7d%02%02c%c3%a2.%c3%bc%c2%b5%2bk%12k%c3%8fw%c3%856%c3%b9%22%c2%a6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%c3%897%c3%87%c3%9d!%c3%a0a%c3%8a%c3%b7%17m%c2%a9%3b%c2%a9%c3%ae!%c3%bal%c3%ae*%3b%20%c2%bb%e2%84%a2%c2%bd%c3%b8%2f%e2%80%9a%c3%b1%c3%b7%c3%b0%c3%bf%e2%80%9dz%c2%8fwq%c2%8f%c3%9d%c3%94%c3%a2%c2%b0%e2%80%94k%c3%9aa%1c%c2%b6%01%c3%b8%c3%85%e2%80%b9%e2%80%b9%5d%e2%80%a1%13h%c3%93%c2%bd%5c%c3%95%e2%80%99%c2%bb%c5%92%e2%80%94%c3%a2%c5%bd%0f%02%c2%b9%c3%a5r%c2%bd%5b%c3%84%2f%19t%c3%ba%c3%b2a%c2%b3b%17%c3%bc%c2%b3%5c%c2%b2%c3%b0x%7c%c3%a5%c3%bb%c3%a5%c3%8f%c3%8fl%3b%5b%c2%ada%5c%20%c3%bf%c3%a2%e2%80%a1%c3%9b%1e%c2%a4c%c3%b8yo%e2%80%a1%20v%c3%b1gu%c2%bb%3d%e2%80%bada%3e%0f%c3%b8%c3%b3.h%c3%b7%7f%e2%82%aco%20%c2%b3%c3%a2%e2%80%9d%14%c2%a3%c2%8fu%7f%c3%91_%e2%80%ba%c2%90%c3%a21d%c3%9fo%c2%b3%04z%c6%92%3f%c2%ab%7b%5d%c2%b2%c3%bf%c2%a7%c3%94b%3d%60%c3%a2ev%06e i assume setting content type may solve , readable information (the content of file) there on .odt file.
the general idea use google drive document parser if possible, can work content.
you've used getdownloadurl gets downloaded same got uploaded. if upload odt document without conversion, when download odt document.
it sounds meant upload convert=true becomes google doc, , download using 1 of exportlink properties.
Comments
Post a Comment