You seem to have json
set as an file ending in your template by <input type="file" accept="json">
. (The template is not supplied so I can't pinpoint the line. This is not an error of the backend (flask) but of the your template code (jinja/html). It would be nice if you could supply a MRE for such issues.
For more information about <input type="file">
take a look at the MDN Documentation .
Example of correct accept
:
<input type="file" accept=".json">
This will only allow *.json
file but keep in mind that users may supply other files manually and create a fallback or validation when parsing/ saving the file.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.