Downloading of files was implemented after feature request https://github.com/jiahaog/nativefier/issues/185 . It works, but suffers from multiple UX problems:
By the way, where are files downloaded? I created draw.io with Nativefier and when I export something (for example, pdf, png) nothing seems to happen. I'm just a beginner with Nativefier actually.
By the way, where are files downloaded? I created draw.io with Nativefier and when I export something (for example, pdf, png) nothing seems to happen.
@bartier files are downloaded straight to your OS-defined Downloads folder. Typically, that would be:
C:\Users\bartier\Downloads~/Downloads@ronjouch Thanks! Additionally, it would be nice if there was an option to change where the file downloaded will be saved (Downloads folder or always asks where to save).
Hey
I just found a way to enable "Save As" (not sure if this is already mentioned before).
Earlier, my web app was by default downloading the file straight to the download folder.
So basically, I just opened up the source files and edited the "main.js".
In main.js, I changed this
if (!opts.saveAs) {
item.setSavePath(filePath);
} to this
if (opts.saveAs) {
item.setSavePath(filePath);
} _Removed the '!'_
This worked absolutely fine, as now the "Save As" dialog box poped whenever there was a download event.
Nativefier 7.3.1, Node.js 4.5.0, macOS
@sameerkumar18 In this case probably the entire _if statement_ could be removed leaving just the dialog opening code:
item.setSavePath(filePath);
Basically it's just a way to force dialog box popup on each download request.
At least notify when the download completes is what i wanted.
I can not find item.setSavePath(filePath); in source code.
version: 7.4.0
+1 ... a way to at least change the download path would be great. It doesn't even have to be a flag, I'm willing to hardcode it manually if that's what it takes. I just want it on my desktop.
O hai everyone interested in this bug: @githubbob42 just contributed PR https://github.com/jiahaog/nativefier/pull/526 , which means a slew of electron-dl options are now available to customize the download experience. So #499 is closed, but the present #335 "Better UX" bug remains open and welcoming contributions.
Feel free to mention here how you use the new --file-download-options flag (that may give ideas to others, and we can include interesting use cases to the documentation), and thanks again to @githubbob42 !
I believe on Windows, the tab in the task bar shows progress/activity while it's downloading (not sure about the other platforms). Also, there is an openFolderWhenDone option in electron-dl that "_reveals the downloaded file in the system file manager, and if possible, selects the file_" when the file has finished downloading. While this isn't as nice as a progress overlay it's a workaround for the other requested features.
As for how I use the --file-download-options, #499 gives a detailed (albeit complicated) example of why I needed the option, but any site/app that has/wants links for downloading files (<a download="myFile.txt" href="...">Download Me</a>) files would definitely benefit from setting the option.
If you're not familiar with the HTML5 download attribute, see:
Most helpful comment
Hey
I just found a way to enable "Save As" (not sure if this is already mentioned before).
Earlier, my web app was by default downloading the file straight to the download folder.
So basically, I just opened up the source files and edited the "main.js".
In main.js, I changed this
if (!opts.saveAs) { item.setSavePath(filePath); }to thisif (opts.saveAs) { item.setSavePath(filePath); }_Removed the '!'_This worked absolutely fine, as now the "Save As" dialog box poped whenever there was a download event.
Nativefier 7.3.1, Node.js 4.5.0, macOS