file-extension

Register a python script as default for file type

北城以北 提交于 2019-12-06 06:02:01
I am making an application with python which will need to be associated with a file type. I need a cross platform solution (can be different for different platforms) that includes setting the icon for the file type, having my application open when a file of that type is double-clicked and being able to reference that file when my application is opened. To clarify Lets say that I have an application called FooEdit, that edits .foo files. .foo files have the mime type of text/plain . Here is the process that happens when a user first gets FooEdit: A user obtains the executable for my application

How to identify the file type even though the file-extension has been changed?

大城市里の小女人 提交于 2019-12-06 05:08:12
This question was migrated from Information Security Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . Files are categorized by file-extension. So my question is, how to identify the file type even the file extension has been changed. For example, i have a video file with name myVideo.mp4 , i have changed it to myVideo.txt . So if i double-click it, the preferred text editor will open the file, and won't open the exact content. But, if i play myVideo.txt in a video player, the video will be played without any problem. I was just thinking of developing an

Associating a file extension with my application

不问归期 提交于 2019-12-06 04:51:44
问题 This question was migrated from Ask Different because it can be answered on Stack Overflow. Migrated 6 years ago . I know how to manually associate a specific file or generic extension with a particular OS X application. (Get Info > Open with > Other…) I know how, in OS X, to drag-and-drop a file with an extension onto an 'unsupported' application. (Hold down command-option when dragging over the application) As the author of an OS X application, how can I specify that my application knows

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

 ̄綄美尐妖づ 提交于 2019-12-06 02:09:44
问题 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 回答1: In IIS, when you create the application for the virtual directory, click on "Configuration" for the application, and edit "App mappings", i.e. add a new mapping for html. Or, in your web.config, in add this sections: <httpHandlers> <remove verb="*" path="*.html" /> <add verb=

What is the difference between .html and .xhtml extension? XHTML is a markup language or it'a different extension also

不想你离开。 提交于 2019-12-06 00:01:55
问题 What is the difference between the .html and .xhtml file extensions? What is the benefit of using the .xhtml extension? Why we are not using the .xhtml extension, is it just because of IE? What about .xhtml extension with IE 8? Is .xhtml supported in other browsers besides IE? If yes, then what benefit we will get when all browsers support the .xhtml extension. Will we stop using .html ? Why do we use the XHTML doctype, but save those files using the .html extension? 回答1: If served over HTTP,

Apache: How to rewrite URL with no file extension and ignore case?

﹥>﹥吖頭↗ 提交于 2019-12-05 23:57:11
I'm running Ubuntu 12.04 with Apache 2.2.22 and PHP 5.3.10. I'd like users to be able to request pages on my site without having to type the '.php' extension, and without having to worry about case sensitivity. For example, URLs like these... http://www.site.com/test/phpinfo http://www.site.com/test/PhPiNfO ...should both lead to: http://www.site.com/test/phpinfo.php I started with case insensitivity by following the accepted answer in this question . Here's what my '/etc/apache2/sites-available/default' file looks like... <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var

How to find file extension of base64 encoded image in Python

左心房为你撑大大i 提交于 2019-12-05 21:52:05
问题 I have a base64 encoded image that I decode and save into an ImageField in Django. I want to give the file a random name, but I don't know the file extension. I have "data:image/png;base64," prepended to the string and I know I could do some regex to extract the mimetype, but I'd like to know if there is a best practices way to go from "data:image/png;base64," to ".png" reliably. I don't want to have my handspun function break when someone suddenly wants to upload a strange image filetype

File extension .DB - What kind of database is it exactly?

泄露秘密 提交于 2019-12-05 20:33:38
问题 I have a database file with .DB file extension. I have been googling and it looks like SQLite. I tried to connect to it using SQLite and SQLite3 drivers and I am getting an error "File is encrypted or not a database". So I dont know if file is encrypted or it is not an SQLite database. Are there any other options what should the .DB extension should be? How do I find out that file is encrypted? I tried to open it in the text editor and it is mostly a mess of charaters and some times there are

What does XAP stand for?

时光总嘲笑我的痴心妄想 提交于 2019-12-05 10:19:25
What does XAP stand for? is it an acronym? I know what silverlight XAP file contains but dont know what it stands for. Silverlight Application Package http://www.sharpened.net/extensions/file/xap http://forums.asp.net/t/1277554.aspx The X doesn't mean anything. I've asked, too. From what I can tell, they didn't want it to look too much like *.ZIP or *.SAP. I would guess X ML A pplication P ackage. When a Silverlight Application is compiled a .xap file is created that contains the application. A .xap file is basically a compiled Silverlight application. The file is actually a .zip file that

Does FileInfo.Extension return the last *.* pattern, or something else?

杀马特。学长 韩版系。学妹 提交于 2019-12-05 09:06:27
问题 I'm curious what exactly the behavior is on the following: FileInfo info = new FileInfo("C:/testfile.txt.gz"); string ext = info.Extension; Will this return ".txt.gz" or ".gz"? What is the behavior with even more extensions, such as ".txt.gz.zip" or something like that? EDIT: To be clear, I've already tested this. I would like an explanation of the property. 回答1: It will return .gz, but the explanation from MSDN (FileSystemInfo.Extension Property) isn't clear why: " The Extension property