How to recognize file type (bytearray type)

Hi,
what ist the simplest way to detect file type or the type of byte[ ]? I mean, for example, how to detect if a "xyz.pdf" is a "really" PDF-File and not some Jpg with ".pfd"-extension.
Thanx in advance
vedran

but there must be a easy wayIn general there is no requirement that a bunch of bytes belong to
some unique "type". So there is no way to retrieve that type and, in
particular, no easy way.
If you want some pragmatic test (and I'm assuming that pdf was
just an example - you want something general), you could have a
look at the nix file command. It is open source and comes with
a big set of useful files describing file headers. It is open source and
can be seen, for example, here: ftp://ftp.gw.com/mirrors/pub/unix/file/

Similar Messages

  • Where is "save as" or how to change file type in Preview in Lion?

    Where is "save as" or how to change file type in Preview in Lion? I used to use Preview to change quickly change a lot of PNGs to either JPEGs or PDFs but with the introduction of versions auto save etc there no "save as" in the File menu. Any suggestions how to get this functionality back or how to get around it within OS X (no Photoshop etc)?

    Just wasted 15 minutes looking for that.  What's wrong with Save As?

  • How to get File type icon for files store on Amazons3

    Hi,
    i want to know about how to get file type icons for files that we store on Amazons3.i am a devloper ,i want to make gui for accessing amazons3.
    so ,i want to know about how to get file type icons for files that we store on Amazons3.
    thanx in advance.

    hi,
    have u heard amazon simple storage service,that provides storage space for
    storing files, i am a devloper,i want to know the files that we store on amazon,how we can get file type icon for that files.
    i want to sample code in java for this.
    thanx in advance.

  • How to change file type associations in SAP ERP 6.0?

    Hello,
    I'd like to figure out how to change the application associated with a given file type in SAP. I want to open a .DOC file, but I am using OpenOffice instead of MS Word. I have .DOC file type already associated with OpenOffice in Windows XP, but SAP doesn't seem to recognize that association. I am using SAP ERP 6.0. Any ideas?
    Mike

    Hi,
    MS Word is mandatory. You will not be able to work using Open Office in SAP.
    Regards,
    Rajesh Kumar

  • Photoshop CS2 for Win 7 won't recognize file type

    I scanned some images using Phtoshop CS2 and saved them in Photoshope as jpgs. But apparently photoshop interpretted the end of the file name that I typed as a file extension - so a file that was called Portrait-06.22.1999 - was saved as a "1999" file as opposed to a jpg file. I can view these images in Windows Photo Viewer or Windows Live Photo gallery but they won't open in Photoshop. How do I change the file type so photoshop will recognize them? I tried just to add a JPG extension to the name of the file but that did not work. Also those photos that had this problem but were listed under "open recent" - I was able to get back in and save again as jpg and now they are fine. What to do with the others? Is there a trick or something I need to download? Thanks.

    Tested an image.  Here are the results.
    If you have bat.test and save it saves as bat.test.  In bridge their is no thumbnail as it is not recognized.  You can rename as bat.jpg and it then works.  Just right click and select rename.
    If you have bat.test.jpg you can rename and just eliminate .test
    Yes, you loose a little bit each time you save a jpg, but if you have it above 9? it is very minute.  You would probalby have to save it dozens of times to see the difference on the screen.  Depends on original pixel size and what you are going to do with it as to whether you will see any difference.

  • How to change file type of iMovie in order to upload it to Youtube?

    When I was trying to upload a video to YouTube, it told me the file type is not supported. All of the articles I could find on Google were for the old version of iMovie. Any help would be greatly appreciated. Thanks! 

    Hey w_squid_98,
    Thanks for the question. The following resource outlines how you can share to various services with the latest version of iMovie:
    iMovie Help: Share online
    http://help.apple.com/imovie/mac/10.0/#move0470816c
    Thanks,
    Matt M.

  • How to repair File Type Associations

    Hi, I have a problem with being unable to mount *.bin files by double clicking them.
    They seem to be associated with VLC at the moment, and I would like to know how to return it so that these *.bin files are automatically mounted/opened when downloaded.
    Which application should I choose to associate *.bin files with so I can do this?
    Is there a different way of taking care of this problem?
    Additionally, I have removed VLC from my computer for this reason, and is there any other thing I should have done besides deleting the VLC folder I had made to contain that application? (e.g. an uninstall)
    I'm a new Mac user so I need a little help

    Hi, lunarist.
    I tested your link using two browsers: OmniWeb and Safari.
    1. With OmniWeb, it downloaded the .bin, invoked my copy of StuffIt Deluxe, scanned it with Norton AntiVirus, decompressed the .bin and mounted the disk image included therein. My StuffIt preferences are set to scan files with NAV before decompressing them. OmniWeb "knows" to use StuffIt Deluxe to expand the .bin because of the file's MIME type and, as a result of having StuffIt Deluxe installed on my Mac, Launch Services has associated StuffIt Deluxe with files of this type.
    Launch Services is the underlying mechanism in Mac OS X that associates documents with applications and vice-versa.
    2. With Safari, the bin was downloaded and decompressed. I was warned the disk image contained a program, and when I accepted that it should be mounted, it was.
    What you're seeing here is that Safari contains the code necessary to decompress the .bin and will do so if "Open Safe Files" is specified in Safari > Preferences > General. That Safari can perform this is common with many Mac-based Internet applications, e.g. browsers, FTP clients, even some mail clients. See section [2.4] of the comp.sys.mac.com FAQ where it states:"almost all modern Macintosh telecommunications and Internet programs have the capability of converting and unconverting MacBinary files for you."However, as previously noted in other posts, you don't have an application installed that will permit you to decompress these files by simply double-clicking them. For that, you need something like StuffIt Expander, a free version of which can be found here. Tiger, unlike prior versions of Mac OS X, does not include Stuffit Expander: see "Mac OS X 10.4: Where is StuffIt Expander?"
    So, as others have advised, install the free version of StuffIt Expander in order to decompress .bin files by double-clicking them.
    They're presently associated with VLC as VLC must claim .bin as a file extension or the MIME type "application/x-macbinary" as one it can open, hence Launch Services has decided that, based on the apps you have installed, that VLC is the only app that claims this file type.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How to Get File type in webdynpro abap

    Hi,
    I am using File Upload UI element of webdynpro ABAP to upload data  into SAP table. I want that the file type should only be tab delimited. How to get the file type to validate the same.
    Regards,
    Dhiraj Mehta

    hi,
    just follow the link :
    http://help.sap.com/saphelp_40b/helpdata/en/2a/fa02b7493111d182b70000e829fbfe/content.htm
    Hope this will help u!!!
    thanks & regards,
    punit raval.

  • Using Photoshop Elements to edit raw.  Doesn't recognize file type

    I recently downloaded photoshop elements to use as my editor within Iphoto. I've set it up as the default editor in preferences, and made the appropriate change in the advanced settings within Iphoto so that it exports edits in RAW. When I attempt to edit by double clicking, Photoshop Elements gives me a msg that it can't open file because it does not recognize the file type. Does anyone know why this would be? I am using a Nikon D60. I haven't downloaded the Nikon software onto the computer (not sure if that has anything to do with it). Does photoshop elements need anything additional? Any help appreciated.
    Thx
    Richie

    Richie:
    As Terence mentioned we can help with using PSE within iPHoto but why PSE doesn't recognize the D60 files is an Adobe issue. I believe there are Adobe plugins available to handle RAW files. Check the Adobe site for those. For using PSE to edit jpgs within iPhoto this may be of some help:
    Using Photoshop (or Photoshop Elements) as Your Editor of Choice in iPhoto.
    1 - select Photoshop as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    NOTE: With Photoshop Elements 6 the Saving File preferences should be configured: "On First Save: Save Over Current File". Also I suggest the Maximize PSD File Compatabilty be set to Always.
    If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and seledt "Edit in external editor" in the Contextual menu). This way you get the best of both worlds
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • How to change file type from .zip to .dock

    I would like to know how to change the saved file type (.zip) to other file types such as (.txt), (.doc), (.dock) or (.pdf).

    It's more complicated than just changing the name of the file to have a different extension.  What you have to do is to convert a file from one format to another.  To do that you have to use an application that knows how to open the original type and how to write the format of the new type.  The application to use for a given combination depends on the combination.  For example, the Preview applications knows how to read a JPG file and write the contents to a PDF file.
    A ".zip" file is a somewhat different case.  A ".zip" file is an "archive" that (generally) contains other files compressed within it.  If you double-click on a ZIP file, it should expand into the enclosed files.
    If you give specific examples of what you want to convert, people should be able to explain what to do.
    By the way, I'm not familiar with a file of type ".dock".  What is that?

  • Png type not recognized in widget - how to edit file type?

    Dear all,
    I almost got crazy these last hours as a nice widget I am working on suddenly refused to work.
    I now understand the source of the problem: the file type of the PNG background image is not "Portable Network Graphics Image" but "Adobe Photoshop PNG".
    This causes the widget to refuse to load, apparently.
    I can not find a way to edit this (even FileInfo does not propose PNG?)... or to make photoshop produce a generic PNG.
    Has anybody encountered this problem and/or has an idea on how to solve it?
    I can not imagine that there is no way in mac os x to edit the inner properties of the file..
    THANKS for any hint,
    Olivier.

    Hi
    I think there's a similar issue in Fireworks, where the native file format appears to be an extended form of PNG. In Fireworks, there's a file export command, which enables you to create a separate copy of the file in PNG (or any other) format whilst retaining the extended PNG for the master version of the file. I'm not a Photoshop user but I would look to see if there's an "export" command, and I would use it to create a separate PNG version of the file, in the hope that this does not have any of the extensions.
    Bob

  • How to display file type - suffix

    I am trying out the trial version of aperture. Immediately found one problem and can't find a solution easily.
    When images are imported Aperture shows the file name only and not the suffix - i.e. DSC0001 and not DSC0001.NEF or IMG001.CR2.
    How do I change this so that I can see what type of file I am dealing with?
    Thanks

    View > Metadata Display > Customize, then Aperture > File Name
    This will allow you to see the name of the Master that is being managed or referenced. Remember, what you see is called a "Version" because it's just a representation of the output after adjustments are applied to the Master. That's why you only see a Version name, which may or may not be the same as the Master.
    Also, if you have the Metadata view open in the Inspector (Library/Metadata/Adjustments), you'll see the file type in the camera window along with all the shooting settings. That might be easier than dealing with metadata fields.
    hope this helps.
    Rob

  • How to get file type within SPFile

    Hi,
    I have a document library and I would like to get the type of document so it can be displayed for the user
    Currently I have this code
    foreach (SPListItemVersion version in item.Versions)
    if (version.Level == SPFileLevel.Published)
    string fileicon = version.ListItem.File.IconUrl;
    string filetype = version.ListItem.File.Item.ContentType.Name;
    string filesize = (version.ListItem.File.Length / 1024).ToString();
    string filetitle = version.ListItem.File.Item.Title;
    string filepath = version.ListItem.File.ServerRelativeUrl;
    Within the code I get the "ListItem.File.Item.ContentType.Name" and this always returns "Document" even if its a Word Document, Spreadsheet, jpg or PDF.
    I really want to display, Document, spreadsheet, pdf, etc etc
    How do I get this property??
    Thanks
    Marc

    You can use the ListItem.File.Name property to get the full file name including the extension, you could then parse this to get just the extension and determine the file type based on that.
    Note that when parsing the file name, if you try to do it by splitting the filename using the period symbol "." as the seperator you will need to allow for file names which contain multiple period symbols. You may be able to use the System.IO.FileInfo class to help, it has an instance property 'Extension' which should take care of that for you, though getting an SPFile into a FileInfo object may be more hassle than just writing your own quick parser, I haven't tried it.

  • How to create file type source system connection

    Hi All,
    I have to load data from Flat files , but when i checked the source system connections File type source system connection is not present. Please guide me how can i create the same.
    Apoorva

    Hi Apoorva,
    Goto RSA1 -> Source System -> Right Click on File Folder .-> Create -> Logical system Name as FLAT FILE -> Source system name is the description for this source -> Enter.
    Once it is created you can right click from that file and check whether it has created properly or not.
    When u r moving the objects which are created under this source, the same flat file source should have been created in the target system also. And check for the entry in the target system table RSLOGSYSMAP for the flat file when u r moving the flat file objects.
    Regards,
    Muthu.

  • How to change file type restrictions

    In Synchronization log, some of my files are not synchronizing because they are being restricted by file type. I am unsure of how to change this restriction in the admin console for iFolder 3.8.4. This is not a file SIZE restriction but file TYPE

    preinhar,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

Maybe you are looking for