|
When coding in java, How to get the corresponding file extension if the mimeType of the file is known?
Started by shrimpy on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For example, Apache Tomcat has ....
Each web server seems to maintain its own listmake a look-up table with the mime-type as the key and the extension as the value.
There is no official list of file extension to mime type mappings.
|
|
Hi,
There are several approaches to fetch the description and default icon for a given extension (no full path), e.g for "*.doc" I want to get "Microsoft Word Document" and the related icon, which do you think will be the fastest one of the following:...
Started by Edwin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Moreove, see How to use the SHGetFileInfo Dictionary(Of String, ... .
In addition, reliably retrieving file information for all file types is not as simple to improve performance as shown below with the file's type name.
The registry.
|
|
I'm moving a PHP app to my IIS 7 web server.
A lot of the files in the application are php files, but don't have the php extension (in fact they have no file extension). This works fine on the old Apache hosting, but I can't get it to work on IIS 7.
I...
Started by Richard on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
If there are alot of them you could perhaps use a find and replace utility to add file extensions..
files, however.
The standard way to do this is to add a mime type and handler for * .
On extension.
|
Ask your Facebook Friends
|
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 have seen bash scripts for changing the file extension but not for just adding one. It also...
Started by seengee on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Note that this....
This will find files without extension for each file.
If you want to execute with spaces (and even newlines...) are properly handled .
Separated file names,
If you do, the names will need to be processed a bit.
|
|
One of my user's Outlook create files with the ".com" extension when they view an e-mail that contains JPG. There's no detectable virus or trojan on this computer. However, Comodo is complaining about ".com" files being created automatically. Is there...
Answer Snippets (Read the full thread at serverfault):
Detected.
If viewing a JPEG results in a '.com' file being created, it's a virus.
|
|
In my application I use a SaveFileDialog to pop up a Save As window. I have restricted in the file type section the file to be saved as .dat with the following code.
sfdialog.Filter = "Data Files (*.dat*)|*.dat*";
What I want to know how to do is make...
Started by novacara on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
For example:
sfdialog.DefaultExt = "dat"; sfdialog.AddExtension = True;.
SaveFileDialog dlg = new SaveFileDialog(); dlg.DefaultExt = "dat"; dlg.AddExtension = true;
The AddExtension and DefaultExt properties .
|
|
This Django ticket says that they will not add a default Django template file extension. What file extension do you use?
Started by Spencer on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Most editors get this right with the....
You would have to do this with a generic extension like .djt.
As mentioned in the ticket:
You already know the files are templates because they are (HTML, CSS, XML, etc).
Of special extension.
|
|
I have this code:
function ShowFileExtension($filepath) { preg_match('/[^?]*/', $filepath, $matches); $string = $matches[0]; $pattern = preg_split('/\./', $string, -1, PREG_SPLIT_OFFSET_CAPTURE); if(count($pattern) > 1) { $filenamepart = $pattern[count...
Started by moustafa on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Basename($path, ".php"); // $file is set to "index"
You have to know the extension to remove if you know the extension, if you dont you can use explode:
$filename = current(explode(".", $file));
['dirname'], "\n"; echo $....
|
|
Is there a one line command in tcsh to change the extension of a set of files? In the various DOS shells, I used to use the following:
ren *.abc *.def
This would rename all files ending in .abc to end instead with .def . In sed terms this would perform...
Started by kwutchak on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
` ) set base = `basename $n .abc` mv $n $base.def end
In *nix world there was no concept of "extension.
|
|
How can I change a files extension using PHP?
Started by PHLAK on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
$new_extension, $filename); }
Then....
Here's a small function that'll do that:
function replace_extension($filename, $new_extension) { return preg_replace('/\..+$/', '.' .
The extension with an extension of your choice.
|