Skip to content

Data is not saved, only empty csv documents in data folder #3129

Answered by ggreeley
imkri asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @imkri -

I recently ran into this issue myself. I solved it by removing the name argument from the saveData() function, like so:

function saveData(data) {

      var xhr = new XMLHttpRequest();
      xhr.open('POST', 'write_data.php'); // see 'write_data.php'; should match the docs
      xhr.setRequestHeader('Content-Type', 'application/json');
      xhr.send(JSON.stringify({filedata: data}));

    };

This potential solution was inspired by #2774 from @jodeleeuw. If the name parameter isn't being used, perhaps the data input is being evaluated in the name position, and the data parameter ends up empty/null. This would make sense with what I was experiencing, at least, such that a file …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ggreeley
Comment options

Answer selected by imkri
@imkri
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants