Automattic / newspack-custom-content-migrator

Custom migration tasks for launching and migrating Newspack sites on Atomic
5 stars 5 forks source link

Try to guess the file extension for external file downloads without one #336

Closed naxoc closed 1 year ago

naxoc commented 1 year ago

This fixes an edge case in import_external_file() where files would not get imported if the url (or file path) they are on does not have a file extension. It uses the mime type to try to sniff out what kind of file it could be. Not 100% good but a lot better than importing 0%