2

I am having issues creating a "export" functionality for my application. There is a reason why I want to do this, and its pretty simple: When people are done doing what they are doing, and in my application it is calculations, people may want to save that data so they don't have to go back and do it again. Here is what I have now:

  methods: {
    createFile: function () {
      var data = `
      Test Data: ${this.chcCalc}`;
      var fso = CreateObject("Scripting.FileSystemObject");
      var s   = fso.CreateTextFile("filename.txt", True);

      s.writeline(data);
      s.Close();

    },
  }

I've been doing some research and it seems it MIGHT not be possible to do this and if so kind of a drag. I'm aware why the above doesn't work but it was the only example I could find.

1

2 Answers 2

4

I found the module: file-saver, so I am using that. If someone else has the same issue I have, and want it you can find the module here: https://www.npmjs.com/package/file-saver

Sign up to request clarification or add additional context in comments.

Comments

0

For those who are using VUE3, file-saver does not work. But this does: https://www.telerik.com/kendo-vue-ui/components/filesaver/

import { saveAs, encodeBase64 } from '@progress/kendo-file-saver';

const dataURI = "data:text/plain;base64," + encodeBase64("Hello World!");
saveAs(dataURI, "test.txt");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.