user196106
user196106

Reputation:

Set ZipInfo mime type

When creating zip archive using python ZipFile, how can i set file mime types?

Upvotes: 1

Views: 1747

Answers (2)

user2665694
user2665694

Reputation:

This question does not make any sense. Files are stored as binary content inside the ZIP archive together with the filesize (and flags afaik). But there is absolutely no mimetype information involved here.

Upvotes: 0

Nicholas Carey
Nicholas Carey

Reputation: 74177

The ZIP format doesn't carry MIME content-type for the individual files contained in the archive, though the ZIP format itself has a MIME content-type: application\zip.

The only way you've got to determine the appropriate MIME content-type for a file contained in a ZIP archive is by examination of the file name and using its file extension to determine the likely MIME content-type.

Upvotes: 3

Related Questions