I am trying to import only.py and.json file, and passing accept as text/x-python-script, application/json, text/x-python
In windows OS, only .json files are able to get imported not the python file.
Pass the filename extension for python files instead of the MIME type
<input type="file" accept="application/json,.py" />
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers
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.