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

Allow changing filename on save #100

Closed
CalvinRodo opened this issue May 26, 2019 · 3 comments · Fixed by #903
Closed

Allow changing filename on save #100

CalvinRodo opened this issue May 26, 2019 · 3 comments · Fixed by #903
Assignees
Milestone

Comments

@CalvinRodo
Copy link
Contributor

Allow the user to set the name of the file being saved.

@MrDeshaies
Copy link
Contributor

MrDeshaies commented Dec 8, 2021

For the JSON file throughout, and the French/English PDF on the results page.

It should pop-open the OS save file dialog, so the user can pick the location and name of the file.

@MrDeshaies MrDeshaies added this to the 0.9.2 milestone Dec 8, 2021
@Ancentury
Copy link
Contributor

This is per Browser settings, not with the code. Here is the steps for Chrome, similar in other browsers.

  1. go to top right corner, click three dots,
  2. in settings, click left side advanced, then download;

or directly input in address bar: chrome://settings/downloads,

you will find "Ask where to save ...", enable it.
image

If you find "Open certain file types ...", then click Clear. It will disable automatically open PDF file.
image

After changing those settings, you should see the save as dialog when you click save or export button.

@Ancentury Ancentury self-assigned this Jan 26, 2022
@MrDeshaies
Copy link
Contributor

Instead of using a download link, could we switch it to the File System Access API (when it is available), or maybe a library wrapping this?

const saveOptions = {
  suggestedName: 'AIA Results.json',
  types: [{
    description: 'JSON',
    accept: {
      'application/json': ['.json'],
    },
  }],
};

const handle = await self.showSaveFilePicker(saveOptions);
const fileHandle = await window.showSaveFilePicker();
const fileStream = await fileHandle.createWritable();
await fileStream.write(new Blob(["CONTENT"], {type: "text/plain"}));
await fileStream.close();

@MrDeshaies MrDeshaies assigned MrDeshaies and unassigned Ancentury Feb 8, 2022
@MrDeshaies MrDeshaies modified the milestones: 0.9.2, 0.9.1 Feb 8, 2022
MrDeshaies added a commit that referenced this issue Feb 10, 2022
#100 filename picker on save JSON and PDF
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

Successfully merging a pull request may close this issue.

3 participants