file-extension

Opening a file in my application from File Explorer

I've created my own application in VB.NET that saves its documents into a file with it's own custom extension (.eds). Assuming that I've properly associated the file extension with my application, how do I actually handle the processing of the selected file within my application when I double click on the file in File Explorer? Do I g...

How to extract a file extension in PHP ?

This is a question you can read everywhere on the web with various answers : $ext = end(explode('.', $filename)); $ext = substr(strrchr($filename, '.'), 1); $ext = substr($filename, strrpos($filename, '.') + 1); $ext = preg_replace('/^.*\.([^.]+)$/D', '$1', $filename); $exts = split("[/\\.]", $filename); $n = count($exts)-1; $ext = $ext...

How do you change the extension that .Net pages will run under?

I need my .net application to use the .html extension instead of .aspx I'm converting a php app and there are external applications which depend on that extension to function. What is the best way to do this? Thanks ...

How to register an extension to a particular custom application programmatically?

How to register an extension to a particular custom application programmatically? For example, i have a custom application created using C# on Windows. How can i register a file extension so when i double click a file with this extension, it starts my custom application and then i can deal with the clicked file in my app? I need to do ...

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...

URL Etiquette?

Given my new understanding of the power of "includes" with PHP, it is my guess that ALL of my pages on my site will be .php extension. Would this be considered strange? I used to think that most pages would be .htm or .html, but in looking around the net, I am noticing that there really isn't any "standard". I don't really think I hav...

What are all these Visual Studio 2005 files for?

I just (re-)joined a company to work on some C++ projects. I'm looking at the files and I'm trying to figure out what all the Visual Studio related files are. Many I suspect are orphans from previous versions of the IDE. I've listed all the file extensions below and annotated the ones I think I understand. If can provide more informatio...

Third-party Uniform Type Identifier implementations?

The madness of file extensions and MIME types and creator codes and magic numbers to determine file types is a huge mess. Coming from a background of Cocoa programming, I supposed I'm spoiled: in Tiger, OS X added a system called Uniform Type Identifiers (UTIs) that makes the entire process sane. Given that I'm doing a bunch of web deve...

If I make a new file type for my program, how do I use "Open With" properly?

I made a program. I also made my own file type, which the program can create, open, and edit. In Explorer, I right clicked on this new file type and selected "Open With" and chose my program. Of course, it just opens the program without loading the file. How do I let my program know that it's being requested to open a file on startup...

How do I find out the path of the file triggered by opening a file with a custom file extension?

How do i get the location of the file that i used to open my programs with? Example: if i create a new extention ".xyz" say and i tell windows that i want to open the file type .xyz with myapplication, then it starts my aplication. Great, but how does my application get a handle on the file path of the file that was used to start it? ...

File Extension to MIME Type Web Service?

Are there any web services which will allow me to provide a file extension and it would return a list of possible MIME types? For example: http://mimetype.com/getMime/doc Which could return: application/msword,application/docappl/text,application/vnd.msword,application/vnd.ms-word,application/winword,application/word,application/x-...

Windows - Unknown File Type & Windows Web "Lookup"

On MS Windows, when you double-click a file with an unknown file extension, the OS presents you with a message giving you a a choice of: 1 - Use the Web service to find the appropriate program 2 - Select the program from a list Is there a way to "register" your file extension with MS (or whoever) to allow your application to show as a...

How do you change the filename extension stored in a string in c++?

Alright here's the deal, I'm taking an intro to c++ class at my university and am having trouble figuring out how to change the extension of a file. First, what we are suppose to do is read in a .txt file and count words, sentences, vowels etc. Well I got this but the next step is what's troubling me. We are then suppose to create a new ...

how to create a custom file extension in C#?

I need help in how to create a custom file extension in my C# app. I created a basic notes management app. Right now I'm saving my notes as .rtf (note1.rtf). I want to be able to create a file extension that only my app understands (like, note.not, maybe) ...

Write/Read external files with custom extensions in VBscript

How do you write or read to external files with custom extensions (like, instead of a .txt extension it could have .cyc for example) using VBscript? I don't know how, and cannot seem to figure it out. For reading a file, is it possible to only read part of a file? For example, if I have a line string1=Hello World! inside of my file, ...

How do I restrict access to files with specific extensions in ASP.NET?

I have in my web application an ADO.NET Entity-Framework *.edmx file. When I browse in the browser (when the application is running) to an edmx file, it doesn't show the error page like when browsing to a *.cs or vb file, it opens the edmx and shows my model scheme to all the users!!! How can I avoid that. ...

How to change filetype association in the registry?

Hi there, first time posting in StackOverflow. :D I need my software to add a couple of things in the registry. My program will use Process.Start(@"blblabla.smc"); to launch a file, but the problem is that most likely the user will not have a program set as default application for the particular file extension. How can I add fi...

recursively add file extension to all files

I have a few directories and sub-directories containing files with no file extension. I want to add .jpg to all the files contained within these directories. I've seen bash scripts for changing the file extension but not for just adding one. It also needs to be recursive, can someone help please? ...

Does anyone know how to make notepad++ treat csproj files as XML automatically?

Dear ladies and sirs. I often use notepad++ for editing of the csproj files. And I always need to go to the Language menu and select XML in order to get syntax highlighting. Is it possible to configure notepad++ to treat csproj files as XML automatically? Thanks. ...

.htm vs .html

Which extension should I choose for my HTML files and why? ...