filetypes

Office 2007 File Type, Mime Types and Identifying Characters

Where could I find a list of mime types and identifying characters for office 2007 files. I have an upload form that is restricting uploads based on extension and identifying characters but I cannot seem to find the Office 2007 mime types. ...

Register file extensions / mime types in Linux

I'm developing a Linux application that has its own file format. I want my app to open when you double-click on those files. How can I register a file extension and associate it with my application on Linux? I'm looking for a way that that is standard (works with GNOME and KDE based systems) and can be done automatic when my program is ...

Finding the default application for opening a particular file type on Windows

Hi there, I'm developing an application targeting .NET Framework 2.0 using C# for which I need to be able to find the default application that is used for opening a particular file type. I know that, for example, if you just want to open a file using that application you can use something like: System.Diagnostics.Process.Start( "C:\.....

Filetype association with application (C#)

Hi, I have a few questions related: 1) Is possible to make my program change filetype association but only when is running? Do you see anything wrong with this behavior? 2) The other option that I'm seeing is to let users decide to open with my application or restore default association ... something like: "capture all .lala files" or...

Is there an easy way to determine the type of a file without knowing the file's extension?

I have a table with a binary column which stores files of a number of different possible filetypes (PDF, BMP, JPEG, WAV, MP3, DOC, MPEG, AVI etc.), but no columns that store either the name or the type of the original file. Is there any easy way for me to process these rows and determine the type of each file stored in the binary column...

Find out the real file type

I am working on an ASP web page that handles file uploads. Only certain types of files are allowed to be uploaded, like .XLS, .XML, .CSV, .TXT, .PDF, .PPT, etc. I have to decide if a file really has the same type as the extension shows. In other words if a trojan.exe was renamed to harmless.pdf and uploaded, the application must be a...

Best way to recognize a filetype in php

What's the best way to discover a file's filetype within php? I heard that the browser may be tricked, so what's a better way of doing this? ...

How can I determine a file's true extension/type programatically?

Hey everyone, I am working on a script that will process user uploads to the server, and as an added layer of security I'd like to know: Is there a way to detect a file's true extension/file type, and ensure that it is not another file type masked with a different extension? Is there a byte stamp or some unique identifier for each typ...

How to detemine the file type in Linux?

If someone sends me a document (.pdf,.doc,.xls, ppt, .ogg, mp3, png, etc) without the extension, how can I determine the file type? The /usr/bin/file command doesn't always guess right or it simply says that I have a Microsoft Office document. I would like to know exactly so I can add the extension to the file name. ...

How to modify Sharepoint filetype icons depending on parts of the filename?

We have a SharePoint Document library, where we store html files with links to external files. Samples: mypicture.jpg.html mywordfile.docx.html mypdffile.pdf.html and so on. Now by default all Files show up with the HTML Icon, referenced in the DOCICON.XML file. Thats of course correct as the .html extension shows, it is a HTML file....

List all applications that handle a specified file type

Is it possible to list all the applications on a machine that can open a specific file type, using only the files extension? for example if I have a text file (.txt), I want a list of all applications that can open .txt files. ...

Is it worth it to lookup the default application in the registry when opening a file from a C# application?

I'm building an application (a side project which is likely to enlist the help of the stackoverflow community on more than one occasion) which will need to open a variety of file types (i.e. open Word documents in Word, not natively in my application). I've been playing with some code for looking up the default application for the file ...

PHP - Read-Only spreadsheet filetype?

I'm using a simple web-based PHP application that outputs a table as a spreadsheet header("Content-Disposition: attachment; filename=" . $filename . ".xls"); header("Content-Type: application/vnd.ms-excel"); //inserts tab delimited text But I'm finding the downloaded spreadsheet opens as a read-only file and must be saved locally and...

How do I associate a custom default build action to a custom file type in Visual Studio?

I have a language service that I have built for a custom file type. In addition, I have created a custom target (build action) within my MSBuild project files. I am however unable to find any way to associate that build action by default to my custom file extension. For example, if you add a .cs file, the build action defaults to "comp...

How do I determine the extension(s) associated with a MIME type in PHP?

Is there a quick and dirty mapping of MIME types to extensions in PHP that I can make use of? ...

Problem validating asp:UploadFile file names with RegularExpressionValidator

I have in the settings file a row of all the file types I want to allow: jpeg|jpg|tiff|tif|png|gif|bmp|eps|wmf|emf|pdf|doc|docx|zip|rar|ppt|pptx|mdb|xls I want to have next to the FileUpload control a RegularExpressionValidator that allows only these files. I am handling it in the PageLoad event setting the ValidationExpression prope...

Mercurial performing binary comparison for certain file types

I've recently started using Mercurial and when I reverted one of my .SQL files, Mercurial performed a binary comparison. This obviously limits the visibility of the changes that were made, as there is no diff. Is there an option to set file types to do a string compare? I'm using Tortioise Hg 0.8.1 with Mercurial 1.3.1. ...

How to identify binary and text files using Python ?

I need identify which file is binary and which is a text in a directory. I tried use mimetypes but it isnt a good idea in my case because it cant identify all files mimes, and I have strangers ones here... I just need know, binary or text. Simple ? But I couldn´t find a solution... Thanks ...

File Attachments in Lists in SharePoint 2007 - how can I limit what kinds of files users can attach to list items?

Hello all, I am working with a custom anouncements list, and I am allowing users to upload documents as file attachments to list items (pretty standard SharePoint functionality, I know). What I would like to do is limit the kinds of files a user is able to attach to a list item. Specifically, when a user makes a new anouncement, I only ...

When checking if a file is MP3 is checking the filename string with an .EndsWith good enough?

I'm doing this: private void LoadSoundFile() { if (openFileDialog1.ShowDialog() == DialogResult.OK) { if (openFileDialog1.FileName.EndsWith(".mp3")) { txtFileName.Text = openFileDialog1.FileName; } else { MessageBox.Show("...