ambiorix-web / ambiorix

🖥️ Web framework for R
http://ambiorix.dev
GNU General Public License v3.0
211 stars 9 forks source link

add support for serialization of common file/mime types #71

Open kennedymwavu opened 2 months ago

kennedymwavu commented 2 months ago

new feature

currently, we have handled serialization of the MOST common file types, as seen in the docs.

it would be valuable if we add support for these too:

why

most R users often need to generate reports. in most cases, the reports are pdfs, a result of rendering via .Rmd or .qmd.

they also happen to use MS Excel and Libre Office a lot, so exporting of the results of an analysis to an xlsx or ods file is popular.

hint

we can make use of the mime map already in Yihui's {mime} pkg. this will, foreseeably, end up simplifying how the response object handles "file downloads" internally.

in the end, we can have a standardized API for handling "downloads", possibly by extending res$send_file() to handle more file types.