Read hwp file minetype from python 2.7

Asked 1 years ago, Updated 1 years ago, 109 views

from mimetypes import MimeTypes

mime = MimeTypes() mime_type = mime.guess_type('C:\SomePath\hangle.hwp')

print mime_type

If you obtain the mine-type of the Korean document from the code above and print out the result, (None, None) is printed out Is there any way to get hwpmine-type?

python2.7

2022-09-21 18:58

1 Answers

You can register the mime type.

If it's Unix or Linux, you can look at the /etc/mime.types or Apache memetype file.

If it is Windows, search in the registry.

Put it under HKEY_CLASSES_ROOT like extensions.

You can put about application/x-hwp in the content type.


2022-09-21 18:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.