content-type

How to set default value for a column of content type in Sharepoint

i create a content type using feature as below <Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt; <Field ID ="{4C939423-2090-413d-B241-724D9B66F74B}" Name="VersionNumer" DisplayName="Version Number" Type="Text" Required="TRUE" Group="CT" > <Default>0</Default> </Field> ...

HttpServletRequest: How to determine Content-Type of requested asset

Hi All, I am writing a quick-and-dirty static file server using Jetty. I need to set the Content-Type for each response: HttpServletResponse.setContentType("content/type"); For a given file request, how do I reliably determine what content type to set? Is it a question of examining the file extension, or is there a more sophisticated...

WSGI content encoding

If I execute the following Python 3.1 program, I see only � instead of the correct characters in my browser. The file itself is UTF-8 encoded and the same encoding is sent with the response. from wsgiref.simple_server import make_server page = "<html><body>äöü€ßÄÖÜ</body></html>" def application(environ, start_response): start_res...

What's the difference of ContentType and MimeType

As far as i know, they are absolute equal. However, browsing some django docs, i've found this piece of code: HttpResponse.__init__(content='', mimetype=None, status=200, content_type='text/html') wich surprise me the two getting along each other. The official docs was able to solve the issue in a pratical manner: content_type is a...

Apache / PHP is serving the wrong content type

I have this PHP file: <?php header('Content-type: text/xml; charset=UTF-8'); ?><?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="hello world example" /> <Content type="html"> <![CDATA[ Hello, world! ]]> </Content> </Module> I would expect it to return a Content-type:text/xml header. What i...

showing contents of textarea as I type

I am going to make a textarea box for input a text and save it and show it in another part... like comment, ... but when i put the text in another area it is plain text....no paragraph no space ... nothing... as it shows here in below as a preview ,.....what i should do? ...

Apache + Mongrel Cluster = Wrong server config!

Hi! I'm trying to get Ruby on Rails going on a Windows 2003 Server. I've installed the Mongrel service and Apache (and RoR, etc). When I serve an app using just Mongrel, everything comes up perfectly. So, now I am down to the Apache configuration... Apparently I can't seem to get that right. When I visit my pages, I am returned the...

Custom content types: XLink vs. Atom

I'm trying to design a RESTful interface for a filesystem-like web service. To provide hyperlinkability among the various resources (files, directories, etc.), I thought I would use XLink. However, it seems there is a strange omission from XLink: content types. Atom provides an attribute to specify the content type of links as well as...

How to get around IE8 32k limit on data:uri on base64 encode?

I need to send an html response to the browser containing a 1920x1080 png. It's a screenshot taken by an html query. I encode the image in base64 and sends it embedded as an text/html content-type. Something simple like : <HTML><HEAD>Whatever</HEAD><BODY><img src="data:image/png;base64,data"/></BODY></HTML> It works fine on FF and Ch...

BlackBerry browser error: The returned page had no content type, and therefore cannot be processed

Hey everyone, I'm developing a mobile web application and I'm currently testing my site against a handful of different devices, such as iPhone, Android, and some BlackBerries. The BlackBerry Bold 9700 (OS 5.0.x) can access my site with no problem, but the BlackBerry Tour 9630 (OS 4.7.x) gives me the following error message when I try a...

What is the correct way to determine the type of a file returned by a web server?

I've always believed that the HTTP Content-Type should correctly identify the contents of a returned resources. I've recently noticed a resource from google.com with a filename similar to /extern_chrome/799678fbd1a8a52d.js that contained HTTP headers of: HTTP/1.1 200 OK Expires: Mon, 05 Sep 2011 00:00:00 GMT Last-Modified: Mon, 07 Sep ...

Django / Python, Make database save function re-usable (so that it takes modelname and appname from strings), using contenttypes or some other method?

I want to make some functions that are re-usable by any model so that I can specify the appname and model in string format and then use this to import that model and make calls to it such as creating database fields, updating, deleting, etc... I had thought I could do this using contenttypes in Django but am trying this, as below and am...

Validate format parameter via config in Spring MVC.

Here is my situation: I have my mvc-config.xml file for my web service set up to have JSON as the default media type. I also have favorParameter for the ContentNegotiatingViewResolver as true. Additionally, I have useNotAcceptableStatusCode as true so that not accepted formats will return a 406. My question is: Is there a way, in the c...

The type attribute of SCRIPT and STYLE elements in HTML?

I heard (from Crockford) what type attributes on LINK and SCRIPT elements are superfluous when those elements are used to load external resources. (Because the HTTP response determines the content-type of the resource.) <link rel="Stylesheet" href="foo.css"> <script src="foo.js"></script> But what about the case when non-HTML code is...

Save response type "Content-Type : text/javascript" in text file

Hi, I am getting some response of HTTP request. Response header is "Content-Type : text/javascript" and some response body. I want to save this response body in text file as "a.txt". Can I do it ? I have "C" files in which I have to do it. Regards PJ ...

Asp.Net HttpHandler and jQuery Ajax call

These are 2 questions. The first one: I have an HttpHandler returning a zip file to download. I have this line of code: context.Response.AppendHeader("content-disposition", "attachment; filename=myzipfile.zip"); The question is: should I declare the ContentType (application/zip) also ? The second question is: I want to call this Http...

Sharepoint Edit or New item meta data page Title shows up twice...

current setup: 1. Parent content type (PCT1) has 5 columns (including Title column) 2. Child content type (CCT1-A) inherites from PCT1 and adds 5 more columns (but child ct also comes with it's own Title column). 3. Now I associates Child control type to a document library. 4. I see two titles in the edit item or new item page 5. If i d...

JavaScript content-type

When I add JavaScript files to web pages, I have always done for example like this: <script type="text/javascript" src="/js/jquery.min.js"></script> <script type="text/javascript"> // Custom script </script> But today I discovered in the response headers that JavaScript are actually served as application/javascript. Why is that? I...

Page displays blank in IE6 only when refreshed does it display

On select pages on my website, the page is initially blank until you refresh it and the content is displayed. The error disappears when the meta charset data is removed: <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> is changed to: <meta http-equiv="Content-Type" content="text/html;" /> The doctype is XHTML 1...

How do I detect plaintext in a MIME file?

I have a large set of MIME files, which contain multiple parts. Many of the files contain parts labelled with the following headers: Content-Type: application/octet stream Content-Transfer-Encoding: Binary However, sometimes the contents of these parts are some form of binary code, and sometimes they are plaintext. Is there a clev...