Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save on browser #29

Closed
fcpauldiaz opened this issue Feb 6, 2018 · 2 comments
Closed

save on browser #29

fcpauldiaz opened this issue Feb 6, 2018 · 2 comments

Comments

@fcpauldiaz
Copy link

How do I save the dbf file on the browser?

@MammutAlex
Copy link

You can use saveAs libe or write in vanillajs

saveAs example

 saveAs(new Blob([toBuffer(dbf.structure(data).buffer)], {
    type: "application/x-dbf;charset=utf-8"
}), 'data.dbf');

vanillajs example

var element = document.createElement('a');
element.setAttribute('href', 
    'data:application/x-dbf;charset=utf-8,' + toBuffer(dbf.structure(data).buffer)
);
element.setAttribute('download', 'data.dbf');
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);

@fcpauldiaz
Copy link
Author

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants