What are the mime types of the various file types native to .NET? - visual-studio-2010

I'm using Visual Studio 2010 to open files from a server, by going to File\Open\File (Control-O) and typing in a URL. The server is serving the document from an URL without an extension (http://hostname/path/document).
If I set the mime type to text/xml, Visual Studio properly opens the document as an XML document when using text/xml, and a JavaScript document when using text/javascript. What are the mime types for .vb, .cs and other native file types in .NET? I've tried text/plain, text/csharp, and others, but all attempts opens as plain text.

Can you serve it with Content-Disposition: attachment and make sure the file name has the right extension? (the URL can stay the same...)

Related

what should be the response content type for excel file

I am working in a jsf+ JBoss gatein based project. In one UI we have a download option as pdf and excel. In response for pdf , set content type as "application/pdf" , working fine .For excel I set it as "application/vnd.ms-excels" .It is working with MS excel. Is it enough for Open office and other spread-sheets?.Or is there any other generalized content type available?
(I have tried "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" but didnt work with MS-excel)
application/vnd.ms-excel works with both excel and open office.

How OneNote accesses url of copied text from firefox, how can I use this in my app

When you copy text from a webpage in firefox (a non microsoft product) into OneNote it adds the url of the webpage along with the copied text as "Pasted from" as in the following example:
Apache OpenOffice is an open-source office productivity software suite
Pasted from <http://en.wikipedia.org/wiki/Openoffice>
How OneNote access the url info of the copied text from a non microsoft app. How can I access similar information programmatically in my apps using c++/C# or other technologies? Is there some api to access additional information from system clipboard like url, source application, source file etc?
As explained in the documentation for the HTML clipboard format, Web browsers can provide an optional SourceURL to specify where the HTML came from.

PyroCMS will upload only on local XAMPP server not on hosting platform

On my XAMPP server I have PyroCMS installed. Version 2.1.4 to be exact. When I go to upload files via the file browser in the admin page it will work. I installed the same version on my hosting platform and whenever I go to upload a PNG file it won't work. This is the error I get:
The filetype you are attempting to upload is not allowed.
I checked the file size limits and changed them to no avail. I was then told I should check the mime type of the image and see if that type is in the CodeIgniter mime type declarations. I did that and it came back as: image/png. Which was in fact in the declaration in and array with image/x-png. Does anyone have an idea of what's going on here? PNG is in the allowed file types and I am well out of ideas...
I fixed it. Adding text/plain as a MIME type to the PNG array in CodeIgniter fixed it.

Turn off built-in rss reader in Firefox 13

A couple of years ago, I designed a bunch of automatic tests for a webapplication using Molybdenum. Some of these checked the data showed in a rss feed through an xml parser. The test required the browser to show the rss as a simple xml file.
At that time I managed to turn off firefox built-in rss reader changing a parameter in the feedconverter.js file. With the major updates in Firefox (4.0 to now) this file is missing and the developers seems to have left no room for this kind of trick.
Do you know a native way to turn off the built-in rss reader?
P.S. = Solutions using the view-source: URL suffix does not work in this case, because the open command answers Failure: Access to restricted URI denied
Things that don't work:
setting "Web feed" content handler to "Preview in Firefox" (shows formatted HTML version, not plaintext XML)
setting browser.feeds.handler to "Reader" (this is an about:config alternative to above) or anything else. There's no plaintext option.
editing mimeTypes.rdf in one's profile folder - Firefox seems not to care about feed settings there
adding a new web content handler with URI view-source:%s - I think it was pretty close, but Firefox escapes the forwarded URL and refuses to open it
storeHtmlSource as it is too smart and does return the code of the formatted page, not the XML source

Display csv inside firefox browser

I need to open a csv file within firefox. By default, it asks me to choose a download location or to open it with an external program. However, regarding the context, I have to display it straight away inside the browser as plain text, without passing by the popup screen which asks me what to do with the file.
I tried to tweak the Firefox "mimetype.rdf" in order to force the content type "text/csv" to be opened in browser. However, I don't find much information about this file, so I was more or less guessing... This is what I came out with:
<RDF:Description RDF:about="urn:mimetype:text/csv"
NC:value="text/csv"
NC:editable="false"
NC:description="CSV page"
NC:fileExtensions="csv">
<NC:handlerProp RDF:resource="urn:mimetype:handler:text/plain"/>
</RDF:Description>
My idea was to force firefox to treat text/csv as text/plain. This code does not work. But anyway, I managed to force content type using "Mason" firefox extension. However, when the browser sees it as a text/plain, it propose me to open it with notepad or download, does not help me much.
I tried other content types, the text/html, text/xml, it always asks me to choose an external application or download.
I tried to use several extensions, "openInBrowser" and "ViewAsText" make me able to do what I want, but I have to explicitely go in a menu and click the "view as text in the browser", no possibility to set a behavior for the content type "text/csv".
How can I explain that I want all the "text/csv" to be opened inside firefox by default?
Any idea?
Thanks
You could have an upload field where the CSV file gets uploaded to the server. Using server-side code (ASPX for example) you could upload the file, then read the contents of the CSV file and display the results using a Response.Write to the browser.

Resources