Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valid rar file invalid mime type #46

Closed
haroonyoeu opened this issue Apr 13, 2018 · 2 comments
Closed

Valid rar file invalid mime type #46

haroonyoeu opened this issue Apr 13, 2018 · 2 comments

Comments

@haroonyoeu
Copy link

Once in a while I run into an issue where rar files won't get extracted due to a missing or invalid MIME header. The rar file will extract successfully using cmd line unrar however I had to comment out the below to successfully get this to run. I wasn't able to check the mime types of the invalid but valid rar files, however I'll check next time I run into this.

# check file really is a rar file if [[ ! "file --mime "${file}"" =~ $MATCHRARMIME ]]; then message error "Skipping file \"${file}\" because it does not appear to be a valid rar file." # Treat this as a failure so we exit with a non zero exit code let FAIL_COUNT=FAIL_COUNT+1 continue fi

@Quibblz
Copy link

Quibblz commented Apr 30, 2020

Depending on your OS you might need to install file separately

@arfoll
Copy link
Owner

arfoll commented Apr 17, 2022

You need the 'file' utility which usually is installed by default but unclear what distro you use.

@arfoll arfoll closed this as completed Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants