"file -i" and "xdg-mime" reports wrong mimetype for zip files

If I run "file something.zip" it returns "Zip archive data" as it should, but if I run "file -i something.zip" or "xdg-mime query filetype something.zip" they both return "application/octet-stream; charset=binary" instead of "application/zip; charset=binary".
I already tried to
remove /usr/share/mime/mime.cache and ~/.local/share/mime/mime.cache, then run update-mime-database on both folders
delete the whole ~/.local/share/mime folder
remove and reinstall mime-types and shared-mime-info
without any success.
I hope someone can help me on this because I've ran out of ideas.

I too got annoyed at those unreliable mime-type inspectors and went searching for a better one that used the command line. I found "perl-file-mimeinfo" which comes with a wonderful script called "mimetype".

Similar Messages

  • Xdg-mime reports application/xml for fodt

    Hi all
    1) I have update the system wide mime database.
    2) Then I have followed instructions here https://wiki.archlinux.org/index.php/Ch … n_via_MIME:
    > cat ~/.local/share/mime/packages/fodt.xml
    =>
    <?xml version="1.0"?>
    <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
      <mime-type type="application/vnd.oasis.opendocument.text">
        <glob pattern="*.fodt"/>
      </mime-type>
    </mime-info>
    >update-mime-database ~/.local/share/mime
    3) Also, just in case:
    >  xdg-mime install --novendor fodt.xml
    But everything to no avail:
    > xdg-mime query filetype eea.fodt
    => application/xml
    instead of application/vnd.oasis.opendocument.text. So xdg-open opens *.fodt with vim (my default app for xml files) instead of libreoffice-writer.
    Any clue???
    Regards
    Carlos

    I too got annoyed at those unreliable mime-type inspectors and went searching for a better one that used the command line. I found "perl-file-mimeinfo" which comes with a wonderful script called "mimetype".

  • I am trying to save a document with the new pages and it will only save as a zip file any ideas on how to change this?

    I am trying to save a document with the new Pages and it is only saving as a ZIP file anyone know how to fix this or choose a different file type?

    Take a look at the FileSelector
    First make sure the FileSelector is expanded so you can see the directory and sidebar. That's what the little disclosure triangle up by the filename is for. Once the FS has been expanded to look like the above picture, look to see what subdirectory has been selected. Use the SideBar to select an appropriate one.

  • I have a large library that I ripped in AIFF using iTunes.  I converted to Mp3 to save drive space, keeping the originals. I have a new computer and want to revert to my original files. iTunes sees the library but is looking for Mp3 files.  Suggestions?

    I have a large library that I ripped in AIFF using iTunes.  I converted to Mp3 to save drive space, keeping the originals. I have a new computer and want to revert to my original files. iTunes sees the library but is looking for Mp3 files.  Suggestions?

    You're welcome.
    For tips on logical organization within iTunes see my article on Grouping Tracks Into Albums.
    tt2

  • TS1717 when trying to import cd the following message appears "the current encoder settings for bit rate and sample rate are not valid for this file"?

    Trying to import cd when this message appears "the current encoder settings for bit rate and sample rate are not valid for this file".  Any suggestions?

    Thanks so very much.  I chose MP3 and Download and it is working beautifully.  Have a wonderful day and it is so nice of you to get right back to me.  I'm trying to cut a DVD for my grandson's grad party and I got most of the photos and didn't have any music since I lost everything in a clean install.  Could hug you!

  • I cannot click on the menu, the beachball is rotating on my desktop, none of the files appear, and when I click on the Finder, the files are there but inaccessible. All applications open. How do I fix this?

    I cannot click on the menu, the beachball is rotating on my desktop, none of the files appear, and when I click on the Finder, the files are there but inaccessible. All applications open. How do I fix this?

    hi there,
    try booting into safe mode, by pressing the Shift button once you hear the startup sound.
    Hope this helps,
    Chris

  • How to get file download dialog box in IE 6.0 for .CSV files?

    In our Java application, when we download .csv file (by clicking a tool bar button or menu item) in IE 5.5, it brings up the download dialog box and when we click the open button it opens the file in a seperate browser window but after migrating to IE 6.0 it doesn't bring the download dialog box and we are not able to open the excle sheet in a new browser window.
    We tried downloading .csv file in IE 6.0 by changing its extension(such as .cs1 and .xls) even then it did not work.We also tried associating CSV type of extension with "Microsoft Excel Comma Separated Values File" in the Windows folder options (Windows Explorer->tools->folder options->file types(tab)), which did not work.
    Please respond if you have come across this kind of issue and solution for the same.
    Thanks in Advance

    This has nothing to do with Java. It's Microsoft
    setting for known file type. IE is responding to the
    setting which will automatically download known file
    type (MIME type).
    To show the "Save As" file dialog, you have to do the
    following (for each file type)
    1. open Window Explorer
    2. click on Tool-->"Folder Option"
    3. click on the "File Type" tab
    4. select the extension and then click on the
    "Advance" button
    5. Check the "Confirm open after download" checkbox
    6. Click OK
    IE should now display the "Save As" file dialog for
    that extension. Remeber, you have to to this for all
    extension you want to see a "file dialog" pop up.Unfortunately this is not the only cause. Even with this box checked, downloading java source files from the pages of The Java Tutorial causes them to open in the most recent IE - I (and others also) don't get the save/open dialog box. Java source files downloaded from (some) other websites result in the save/open dialog box. I believe that one of the security changes that MS made in IE's handling of files is the cause. The setting of content-disposition by the server appears to be the key, according to MSDN information.

  • Jar files downloaded from SkyDrive are being renamed to jar.zip files

    I have cut and pasted the following series of exchanges from when I posted the problem onto SkyDrive's support forum. I hope that someone might be able to propose a better solution to the problem that I have. Thanks for your help.
    MDSms asked on
    Uploaded jar files convert to jar.zip files when downloaded from SkyDrive
    I have uploaded an executable jar file to SkyDrive. (I will call this FILE.jar). The file is intact and indicates that it is a jar file type when the file is viewed by Properties within Skydrive. However, when I download (or others download through a share link) the file, it is being saved onto the local computer's download file with .zip appended to the file name (FILE.jar.zip). The downloaded file can be renamed to remove the .zip appendage and subsequently run successfully. However the folder options for the folder where the downloaded file resides must be changed for disable "Hide known file extensions" prior to being able to remove the .zip appendage. While I have figured out the workaround for this problem, this manual renaming procedure is entirely too cumbersome as a solution for sharing this file with others. How can I prevent or disable the FILE.jar file from being renamed to FILE.jar.zip when it is downloaded from SkyDrive?
    All Replies (5)
    Audrey_P. replied on
    Forum Moderator
    Hi,
    Thank you for posting. Let me try to assist you with your issue with your files.
    In order for us to reproduce the issue on our end. Please provide us with the exact steps that you did when you uploaded the files as well as the steps when you are downloading it.
    We will be needing the steps to help us figure put what is causing you this issue.
    We look forward to your response.
    Thank you.
    Audrey P.
    MDSms replied on
    Reply
    The file was uploaded by first logging onto my SkyDrive account using Windows 7 Pro and Firefox browser, then a new folder in my account was created without sharing privileges, then the folder was opened and the FILE.jar was uploaded into the folder using the "Upload" option on skydrive account menu. Sharing privileges for FILE.jar were then created (view only), and the shortened url link was sent to the individuals that I was trying to share the file with. was then turned on. When these people use the link to download the file, it is being saved as FILE.jar.zip.
    When I try to download the file through the skydrive account download option, it is being saved onto my computer as FILE.jar.zip and this occurs when I try to download the file while signed into my skydrive account as well as when I am not signed into my skydrive account (using the shared file link).
    This PNG shows the information provided by clicking on the download icon (down arrow) within the Firefox browser; note that the file was downloaded as FILE.jar.zip and that the source was live.com. When I use Windows Explorer to look at the same file within the Download folder itself, examining the file's properties details also shows that it is being saved as FILE.jar.zip and is of the file type compressed zip folder.
    This PNG shows the information displayed to me from my skydrive account when I view the originally uploaded file's properties; note that the information shows that the file is a jar file type.
    When I utilize Internet Explorer 9 to access the file, FILE.jar is being downloaded onto my computer as a jar file type. This PNG shows the information provided by Tools/View Downloads within the IE9 browser. Note that in this instance, the information indicates that the file is being downloaded from yzudea.blu.livefilestore.com.
    It appears to me that the problem (the FILE.jar file being renamed to FILE.jar.zip) arises from the fact that a jar file downloaded from skydrive using firefox, is being sent from live.com whereas a jar file downloaded from skydrive using IE9 is being sent from yzudea.blu.livefilestore.com.
    I want to make sure that a person receiving a share link from me for FILE.jar is able to download it without modification to the file name regardless of which browser is being using to access the link. How can I make sure that this occurs?
    Any help is appreciated. Thanks.
    Michelle Anne D. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    I appreciate you for providing as much information as you can about the issue, as well as for uploading screenshots on what you see from the downloaded file. About your initial concern wherein the file gets renamed with .zip after the original file extension, this is solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented.
    Moreover, you may see the file servers live.com and yzudea.blu.livefilestore.com to be different with one another, but they actually are sent from the same SkyDrive server. This in turn, depends on the web browser where the file is being downloaded as well. The live.com file where it was downloaded from Firefox simply masks its original server yzudea.blu.livefilestore.com.
    As for your last query about your recipients downloading the file without the hassle of renaming it from a .zip file, you can simply tell them to download it through Internet Explorer.
    Should you have other queries or additional information that might help in our investigation, I highly encourage you to post them here.
    Regards,
    Michelle
    MDSms replied on
    Michelle,
    Thanks for your reply. Yes, I could simply tell them to download the file through Internet Explorer, but is there another solution or workaround to the problem I have described here? Am I being punished with the curse of this problem simply because I (or the individuals with which I wish to share FILE.jar with) choose to use Firefox instead of IE? Will the use of any other browser instead of IE (Chrome, Safari, etc., etc.) still result in the same problem?
    You stated that it is "solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented"........could the problem be overcome by designating one or both of the file server addresses as Trusted Sites within the browser options setting?
    I look forward to your response. Thanks in advance.
    Joy V. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    We understand your concern. Since the issue does not occur in Internet Explorer, it has something to do with Firefox's security feature. You might want to verify this concern by contacting Firefox support.
    Hope this helps. Let us know if we can further assist you with SkyDrive.
    Thanks,
    Melanie Joy

    Try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions

  • How to do document offset in Simple Plain to XML for Zip file Sender side

    Hi,
    Scenario is .zip file to IDOC, A idoc per a record. .Zip file has simple Plain structure like below. Tab delimiter.
    Name  number   code   country   Rating  Item
    ABC    123        C4        IND           I2        PRD
    ABD    123        C4        IND           I2        PRD
    ABE    123        C4        IND           I2        PRD
    I am using Adpater Module  and  Header is generating  a IDOC (total 4 IDOCs) in ECC. I would like to use similar to file 'document offset ' option in Adapter Module to skip the header row. so, I need only 3 IDOCS.
    plain2XML and using MsgTransfermationBean.
    I tried with
    xml.documentSkipFirstRows=1
    xml.documentOffset=1
    xml.addHeaderline=0
    I came to know that  above all for STRUCTURAL Plain parameters so no use.
    I checked this http://forums.sdn.sap.com/thread.jspa?threadID=1223739
    http://help.sap.com/saphelp_nw04/helpdata/en/70/f3cbad30ee479cb15672219f3405f0/frameset.htm
    Could you please help me with proper parameter to skip the header/first record of the file.
    Thanks
    shoukat

    Hi Shoukat,
    Try with the following parameter:
    xml.processFieldNames = fromFile
    As of SAP Help: "means that the field name information is located in the header line of the file to be converted."
    Hope this helps,
    Greg

  • Set the password for zip file in unix

    Hi All,
    I have used the below command to zip the file and it is working fine.
    cd /YYYY;zip -r ZZZZ.zip ZZZZ.TXT
    While using the below command to set the password on zip file , I am getting error like "zip error: Invalid command arguments (encryption not supported)
    zip -P password -r ZZZZ.zip ZZZZ.TXT
    Can you please help me how to set the password for zip file in UNIX.
    Thanks,

    Do you use any characters in the password that might confuse the zip command? (like '-' or ';'?)
    If I use the command in RHEL4:
    cd /tmp
    zip -P password -r tt.zip gconfd-oracle
    adding: gconfd-oracle/ (stored 0%)
    adding: gconfd-oracle/lock/ (stored 0%)
    adding: gconfd-oracle/lock/ior (deflated 67%)

  • Best free / cheap software for zipping files?

    Is there any free / cheap software recommended for zipping files that works well with a Mac?

    OS X includes an utility to compress and decompress ZIP files. It's called "Archive Utility" and it's stored on /System/Library/CoreServices, but you have to modify some settings.
    To access to this utility, open a Finder window, select Go menu (on the menu bar) > Go to Folder, and type /System/Library/CoreServices. Then, open "Archive Utility".
    By default, this app compresses files in a CPGZ file, but you can modify this. Go to Archive Utility menu (on the menu bar) > Preferences, and choose "Zip archive" next to "Use archive format".
    Then, to compress files, just close the Preferences window, and go to File menu (on the menu bar) > Create Archive. Finally, choose with the Command key the files you want to compress, and press "Archive", so a ZIP file will be created

  • Reporting wrong properties for H.264 File

    I copied a .MTS AVCHD M.264 file from the chip recorded by a Panasonic HDC-SD1 to my hard drive and the Properties reported are 1440 x 1080 by Windows 7 and Premiere Pro 5.0.  It looks as if it is actually 1920 x 1080 and other programs report the file this way.  Do I need to update some software, or is this a misnomer that I should ignore?

    >Premiere Pro 5.0
    Current is 5.0.3 for Windows, which includes several fixes and enhancesments... you need to update
    All Adobe updates start here and select product, read to see if you need to install updates in number order, or if the updates are cumulative for the individual product http://www.adobe.com/downloads/updates/
    Also, See 2nd post for picture of NEW ITEM process http://forums.adobe.com/thread/872666 to be sure your project sequence matches your video file

  • Disk Utility: Reporting wrong size for disk after a restore

    First up, hardware is G4(PPC) running OS 10.4.11
    I've just purchased and installed a new 500G drive for this old workhorse as an upgrade for the previous secondary drive. Set it up with a single partition, JHFS+. No problems so far. Went to copy the files from the old drive to this new one and thought, "Why don't I try that handly looking Restore button?". +Yeah, apparently a bad idea+. The old drive is 120GB. I set its (only) volume to be the source and my newly created partition to be the target; set it going and left it alone. All appeared to be well when I came back, until I checked the available space on the new drive.
    Disk Utility now reports that this new, 500G drive has a Total Capacity of 128G (137,438,952,960 bytes).
    *Remedies tried so far:*
    - I've tried reformatting/partitioning, but wasn't able to convince it otherwise. Also tried it booting from an install DVD just in case that made a difference.
    - I downloaded a utility from the drive manufacturer which I managed to get on to an ancient, dusty w2k box. Reformatted the drive with 2 NTFS partitions. This seemed to do the trick as they both mounted when I rebooted the Mac. However, when I went to reformat the volumes to JHFS I noticed that the total disk size was still being reported as 128G. Still, they reformatted fine and I transfered my data to them. On a reboot, though, the Mac decided that it didn't want to see the second partition and only shows me disk1s10, ignoring the second partition I set up.
    - I have an identical, empty drive to the 500G. I thought I might be able to use the Restore "feature" to trick it back. Set up the second 500G in a firewire box, ran the restore from the empty volume to the screwed up one. No dice.
    I thought that OS X ignored any sort of BIOS info on a drive and merely looked at the physical media. Is this correct? Does it store this gathered info in a file somewhere that I can delete?
    *This is a call for help.*
    I have no problems playing with the command line as root, if that's the sort of suggestions you've got. I just thought I'd ask here before I fdisk/dd etc from new500 to old500. Geometry of the new500 is 60801/255/63.

    Thanks! That sounds like a good short term solution for a backup.
    EDIT: Cross reference link for anyone who happens to google this thread with a similar problem:
    http://discussions.apple.com/thread.jspa?messageID=7230072&tstart=0
    Message was edited by: mr_lunch

  • Dreamweaver CS6 displaying the wrong icon for certain file types

    I recently upgraded to the Maverick and I noticed that my Dreamweaver changed some of my files' icon to Acrobat Reader symbol. This does not represent the actual file type. My most important files, such as mp3 and m4v, are not displaying correctly. My concern is that it is affecting my website. How do I change the icons back to the original file type icons? Much needed help! Thanks!

    What do local file associations have to do with your website? You have a severely wrong understanding of this stuff. Anyway, file associations on Mac can be changed using a right-click and Get Info and then choosing a new default program for the file type.
    Mylenium

  • For some reason, my compression option is grayed out under "File" menu, and when I select a folder with multiple files, or multiple documents, and try to right-click or tap the mousepad with two fingers, I do not get a "compress" option available. Help.

    I don't know why, but when I select a folder with multiple docs contained within it, or multiple files, the Compress option is grayed out under the File menu, nor is it available when I right-click. Please help.

    Yes it is, but I have the same problem of the option does not appear with "right click" (I'm actually control-clicking), and COMPRESS is grayed out under the file menu. I'd like to fix it.
    Hmm. After finding the Archive Utility,* I tried archiving the folder. It came out as .cpgz, ugh. Found there was a preference to make .zip the default. It worked!
    And now…the menus are not grayed out. ?!?! OK.'
    Hope this helps someone.
    *You cannot find this via search, apparently it is a hidden file, you have to click from the root drive through to /System/Library/CoreServices (Thanks for the file path Alberto!)

Maybe you are looking for