Microdot - send file to download

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
vinz-uts
Posts: 22
Joined: Fri Sep 10, 2021 9:22 am

Microdot - send file to download

Post by vinz-uts » Fri Feb 04, 2022 1:53 pm

Hi, I'm trying to use `microdot` library to build a little web app on a ESP32. I'm newer in HTML coding, I would send a text file stored in the micro to the browser used by the user for download it. If I use the `send_file` function, the browser receive the file and automatically display it. I would try to open a pop-up window on the browser to download it as an attachment. Anyone is familiar with `microdot` and HTML? Thanks a lot for your support!

bazooka07
Posts: 6
Joined: Wed Nov 03, 2021 3:45 pm

Re: Microdot - send file to download

Post by bazooka07 » Mon Feb 07, 2022 7:34 am

Hello,
You need to add extra http "Content-Disposition" header
Don't forget to add "Content-Type" header.
See : https://developer.mozilla.org/en-US/doc ... isposition

Post Reply