You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

haider197's avatar
haider197
New member | Level 2
6 years ago

read choosed file cotent

i'm using dropbox chooser , it works well for me , but i want to read the choosed file cotent and put it in a textarea , i'm using the piece of code 

$.get(files[0].link, function (data) {

console.log(data); // <-- this will log the contents of the file

});

but i'm getting an unclear text ,

NOTE:the file extension is docx .

 

  • Hey haider197, I moved your post here, where some like-minded users will have some ideas to share with you. 
     
    In the meantime, could you also send us a screenshot (without any personal info) of the behavior you’re experiencing so as to have a better visual understanding?
     
    Thanks in advance! :grin:
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    It sounds like you're using the Dropbox Chooser with a "direct" link type to access the file data for the chosen file. 

    I see that you already have the Chooser part working, and you're able to retrieve the file data from the returned link. What you do with the data from there is up to you, but note that the Dropbox link will just return the raw data for the chosen file. 

    In this case, that will be the raw .docx file data. The .docx file format isn't plain text though, so it won't be directly human readable. You may need to use some third party library for reading the docx format and getting out whatever information you're looking for. 

  • Lusil's avatar
    Lusil
    Icon for Dropbox Staff rankDropbox Staff
    Hey haider197, I moved your post here, where some like-minded users will have some ideas to share with you. 
     
    In the meantime, could you also send us a screenshot (without any personal info) of the behavior you’re experiencing so as to have a better visual understanding?
     
    Thanks in advance! :grin:
    • haider197's avatar
      haider197
      New member | Level 2

      what i want to do is :

      * the  user select a file from his own dropbox (it's done ), once the file is loaded , its content will be dispalyed in the textarea 

      note : I accidentally hit the mark as resolve button

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        It sounds like your question is more about general web programming than anything specific to Dropbox, so I'm afraid I can't be too helpful. You may be better helped on a general web programming forum.

        So far, I see you are able to retrieve the data from the link. From there you may need to interpret or convert that data (e.g., since it's a docx in this case), and then use JavaScript to update that textarea to display the desired content. 

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,915 PostsLatest Activity: 6 hours ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!