Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

It’s also very difficult to save the received data to the browser as a file. It can be done with ugly hacks, but this should be supported natively in 2022. Background downloads are still a major PITA. Why?


I don't have a lot of front end experience, but the way I've done it in the past was with

    <a download href="example.com/my/download/route"></a>
and that always worked well for me. No idea if that would be helpful at all, I'm operating at a very surface level knowledge here.


That's the way to do if I want to just download a file. But the comments seem to be mentioning a scenario where they would like to download the file via Javascript.


You can do anything with the DOM in javascript - you could create an anchor node then download the file automatically via a.click()


That's how I do it now. And it's an ugly hack. Why is it not natively supported?


What would you consider a native support? ability to drop files on user drives without prompt?


No, of course not. I’m not talking about the user experience. I’m talking about native support in the fetch API to take downloaded data and save it to a file. User experience might be the user being prompted for a location, etc, just like now when saving a file through a hyperlink download.


I’m talking about saving data received from an asynchronous fetch response as a file on oval file system.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: