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

fangzefunny's avatar
fangzefunny
Explorer | Level 3
3 years ago

dropbox.filesUpload sometimes does not work

Hi,   I am now doing an online experiment via URL and trying to collect data using dropbox javascript SDK. At the end of the experiment, the success message was always prompted. But the data wa...
  • Здравко's avatar
    3 years ago

    fangzefunny wrote:

    ...

    At the end of the experiment, the success message was always prompted. But the data was not always uploaded to my dropbox. 

    ...

    ...
    var saveDropbox = function(content, filename){
        dbx.filesUpload({
            path: "/" + filename,
            contents: content 
        })
    };
    ...

    ...

    Hi fangzefunny,

    In your 'saveDropbox' function, what are you doing with Dropbox 'filesUpload' method result? On success there should be received a file metadata to the file just uploaded and on error - the corresponding error information. As far as I can see, you are ignoring this information. In this context, you function always succeeds regardless if actual upload succeeds or fails. The information of the error pointing the reason of an upload fail is lost too. That's why you never get any error message and your 'success message' always appears. 😉 Be more careful.

    Hope this gives direction.