Forum Discussion

Saikiran's avatar
Saikiran
Explorer | Level 3
9 years ago

I have a CSV file with headers/fields?

 

OwnerId,FirstName,LastName,MailingStreet,MailingCity,MailingState,MailingPostalCode,MailingCountry,Phone,RecordTypeId,Email,Campaign,IF_Local_Leader__c
005A0000001EHjd,jan 16 test for ACTON,kumar,,,,,,,012A0000000K4y8IAC,Test10@gmail.com,701q0000000K2Us,TRUE
005A0000001EHjd,Jan 16 If local check,Kumat,,,,,,,012A0000000K4y8IAC,testiflocal@gmail.com,701q0000000K2Us,TRUE
005A0000001EHjd,gowtham,test,,,,,,,012A0000000K4y8IAC,testacton123@gmail.com,701q0000000K2Us,TRUE

 I have a CSV file with headers/fields as like above

 

but when i preview/open the file in the dropbox it is coming in different format?

like

{"type":"Buffer","data":[79,119,110,101,114,73,100,44,70,105,114,115,116,78,97,109,101,44,76,97,115,116,78,97,109,101,44,77,97,105,108,105,110,103,83,116,114,101,101,116,44,77,97,105,108,105,110,103,67,105,116,121,44,77,97,105,108,105,110,103]

 

 

scenario is like this?

1. I used dropbox API to connect from Nodejs.

2. successfully connected.

3. stored a file in Apps folder.

4. created a folder there.

5. drop some files(csv files) in that.

6. but when i try to open the csv files the format is completely changed ..

it is giving like

types: buffer

data: [,,,,,,]

 

....

 

Please hlep on this.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:

    - the name and version of the SDK/library you are using, if any
    - the relevant code snippet(s)
    • Saikiran's avatar
      Saikiran
      Explorer | Level 3

      Thanks .

      My sdk version 1.3.14

       

      My code is given below, here am reading my local csv file and passing that value to the dropbox.

      i.e, upload a csv file to dropbox.

       

      var node_dropbox = require('node-dropbox');
      var fs = require('fs');

       

      var api = node_dropbox.api('<REDACTED>'); //my access token


      var f = '/Users/saikiran/Downloads/ifg_localleader_contacts.csv'; // my local csv file
      fs.readFile(f, function (err, data) {
      if (err) { throw err; }

       

      api.createFile('12.csv',data, function(err, res) {
      console.log(err);
      });
      });



About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 2 days ago
351 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!