Open braughtg opened 3 months ago
For anyone seeking to resolve this issue, there are some pretty conflicting responses on whether or not saving to a specific directory is possible. [This] StackOverFlow forum has many users noting that it's impossible because it would pose a serious security threat to users. However, [this] website has an example of saving a file to a specific directory location. It's incompatible with Firefox though, and I wasn't able to make it work on Google Chrome or Edge as it suggests you use. It mentions using the [File System Access] but this might involve incorporating this project into our own which might be undesirable. There seems to be a much newer, and more maintained, project that could be a helpful resource. The [File System Standard] seeks to,
define[s] an API that makes it possible for websites to get access to a file system directory without having to first prompt the user for access. This enables use cases where a website wants to save data to disk before a user has picked a location to save to, without forcing the website to use a completely different storage mechanism with a different API for such files.
This project's GitHub repo can be found [here] but this could also mean incorporating something into the project that might be undesirable for functionality that's more of a leisure than a necessity.
Additional resources: Note, the goal is to save a file to the system with a file explorer that allows the user to specify where in the system they want to save the file.
Comment by FutzMonitor Tuesday Feb 21, 2023 at 15:00 GMT
If this was an implemented feature, would it be worthwhile to add another issue allowing admins to configure whether the CSV is downloaded straight to the downloads folder or a specified directory?
I think so since it would be nice to switch between the two. This would necessitate more updates to the CustomTable, UI, and both their testing files.
Comment by FutzMonitor Friday Mar 03, 2023 at 16:52 GMT
If this was an implemented feature, would it be worthwhile to add another issue allowing admins to configure whether the CSV is downloaded straight to the downloads folder or a specified directory?
Possibly a simpler solution would be to have the "Save As" dialog that would open default either to Downloads, or preferably just to the last location that the user had used. That's still 2 clicks instead of 1 to get something into downloads if that is where you always put it. But I am hesitant to make more configuration options than we really really need.
That said, when someone works on this issue we can revisit this point.
Comment by braughtg Friday Mar 03, 2023 at 19:54 GMT
Current Functionality
Desired Functionality
The CSV function is located inside of the CustomTableComponent.js file. Altering this file means the contributor should also add an additional test into the CustomTableComponent.spec.comp.js file if possible (or opening another issue so somebody else can do it) to make sure that the file has full coverage of the component's functionality.
Good place to start: here
Original issue by braughtg Thursday Aug 17, 2023 at 19:17 GMT