Don't know How to save .docx file from google drive
See original GitHub issueI have tried many methods - node.js write Buffer, Streams etc.
var xhr = new _XMLHttpRequest();
//children is response of `get` file
xhr.open('GET', children.downloadUrl);
xhr.setRequestHeader('Authorization', 'Bearer ' + _accessToken);
xhr.onload = function() {
fs.writeFile(children.title, xhr.responseText)
});
Content of xhr.responseText
is something like that
��▬h��↕E6M��~��3�3∟�9�� � �►��/2�:���♂�4��]�♀I�R���►
$SB6Q���c↔��H�=;+
���►q�3Tdכ��@!T��hEl_�|�I�↨��h(�^:▬�[h̓D♠��f���♠*���ݾ��M→
�1⌂♦"N�↑�o�]�7U$��A6����♠�W��k`�f▬♫��K�Z�^‼�0{<Z�▼�]F�����
���J♥A♀��♣�a�}7�
"���H�w"�♥���☺w♫̤ھ�� �P�^����O֛���;�<♠�aYՠ؛`G�kxm��PY�[��g Gΰino�/<���<�1��ⳆA$>"f3��\�ȾT��∟I S�������W♥����Y
Please help me to know what is the format of the data I am getting from Drive Api and write it in which format so that I got a complete .docx file
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to download a Docs files without converting it
You can download to other formats by opening the Docs document and going to File > Download. However, if you try to download...
Read more >How to Save a Google Doc as a Word File - Daemen College
1- Open up the file you want to download in Google Docs. In this case, I opened a file called “docx”. 2- Next,...
Read more >how to edit and save a word document in google docs drive
Assalamu Walaikum, in this video, I will show you, how to edit and save a word document in google docs drive. let's get...
Read more >How to save a Google Doc as a PDF or Word document
Click Microsoft Word (. docx) to save your Google Doc as a Word document. Click PDF Document (. pdf) to save your Google...
Read more >How to enable .docx creation in the Google Docs app
If you plan to share the file immediately, save it locally. If you plan to work with the document from the web-based version...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is an example of how I am downloading files: https://gist.github.com/davestevens/6f376f220cc31b4a25cd
An example for just a single file:
Just posted an answer on SO. To summarise, XMLHttpRequest does not support binary downloads; you need to use something else that does.