content-type

Grouping content by category - Drupal

Hi folks, is there a good way of grouping content up by category. I wish I could have a CCK category field. ...

Drupal 6: Drupal Themer gives same candidate name for different type of content types

Hi friends, I'm a drupal newbie... I have different type of contents like News, Events, etc. and their content is different. News detail page has title-content text-date. but Events detail page has title-date-content text-location-speaker-etc. So I need different layout page for these different types. So, I enabled Drupal Themer to get...

Getting the correct headers automatically given a filetype in PHP...

Sorry - looks like this is a duplicate of: http://stackoverflow.com/questions/1232769/how-to-get-the-content-type-of-a-file-in-php A few times I've run into situations where I'd like to be able to include a file using PHP, and depending on the included filetype, output the appropriate headers. In the past I've just done this manually ...

Open PDF Content files in ASP.NET MVC 2

I want to provide simple href links to my PDF forms that reside in my Forms folder. I have a created a simple Index.aspx and FormController Index action that simple iterates through the list of PDF files using my FormMetaData.xml file. The links get created just fine but when you click on the links I get a 404 exception. That looks li...

chrome renders js different depending on the extension of the file to render [testcase included]

I was trying to implement an image panner I found here Chrome renders the same document differently depending on the extension of the file requested. I have created a test case, where it works when the file it's not named as test.xhtml You can download the test case from here Does anybody know why or how to solve it? I want my files to...

What do browsers want for the Content-Type header on json ajax responses?

I am returning some json which needs to be handled by javascript as the response to an XMLHTTPRequest. If I set the response's content type to "text/plain", all browsers but Chrome will accept it and pass it to my JS with no problem. However, Chrome will wrap the response in <pre style="word-wrap: break-word; white-space: pre-wrap;"> ...

ContentType issue with commons-upload and httpcomponent client

Hi, I am trying to develop a Http client which uploads a file with httpcomponents: HttpPost httppost = new HttpPost(myURL); httppost.setHeader("Content-type", "multipart/form-data; boundary=stackoverflow"); httppost.setHeader("Accept", "text/xml"); MultipartEntity reqEntity = new multipartEntity( HttpMultipartMode.BROWSE...

Rest Content Negotiation and Caching

I'm wondering how caching works with content negotiation based API. Since the to get a resource in XML or JSON, the URI will be the same, for example: http://example.com/bikes/mountain The service returns JSON / XML based on the Accept type header. How smart are caches? For example: if one client requested this using Accept t...

How Do I Set XML Content-Type in Flex 3?

Hi, I've got a Flex 3 project. Flex makes an ExternalCall to some Javascript. The Javascript is then turned into XML. But, my xml isn't parsing in IE. It works in all other browsers. I think that the problem is that I haven't set the XML's content-type and IE doesn't like that. So my code looks like: myReturn = '<myXMLReturn>' + my...

Set Content/Media type - Restlet

How do you set the content type in Restlet (version 2.0 for google app engine)? In this case, I'd like to set the content type to ""text/xml". I have: public class SubResource extends ServerResource { @Get public Representation get(Representation representation){ setStatus(Status.SUCCESS_OK); StringRepresentation sr = n...

How to get file content-type with PHP < 5.3?

How do I retrieve the content-type of a file using PHP? I don't want to rely on the file extension alone. Thanks! ...

Is there an up to date list of all common content types returned from web servers?

For intance, text/html, audio/mpeg, etc? Can I safely assume that anything that is text based will actually have text/??? as its content type in the header when the server returns the document? ...

Apache serving wrong Content-Type for Rails files

Apache keeps serving up my Rails files with a Content-Type of 'text/plain' in the header. I have mod_mime installed, a mime.types files with all the correct MIME assignments, and the following code in my configuration. Any thoughts? DefaultType text/plain <IfModule mime_module> TypesConfig /etc/apache2/mime.types AddType applic...

how to set Content-Type automatically when i download the data that i uploaded.

this is my code : import os from google.appengine.ext import webapp from google.appengine.ext.webapp import template from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.ext import db #from login import htmlPrefix,get_current_user class MyModel(db.Model): blob = db.BlobProperty() class BaseRequestHandler...

how to detect response content-type in asp.net mvc

hi, I've wrote very simple minification/compression handler that minify css and js by indicating request type (Request.RawUrl.EndsWith("css" || "js")), but i don't know an approach to indicate which response type is html and then minify that as HTML-content because in mvc isn't extension to checking. thanks in advance ;) ...

Django: return one filtered object per foreign key

Is it possible to return querysets that return only one object per foreign key? For instance, I want the to get the latest comments from django_comments, but I only want one comment (the latest comment) per object, i.e., only return the latest comment on an object and exclude all the past comments on that object. I guess this would be ...

Making a content generator Apache module that only works for text/html requests

The title of this question may be a bit misleading. I couldn't quite think of anything better. Here is my problem. I am developing an Apache module that needs to manipulate a bit of content in the requested HTML document (this document can be a file on the disk or may be dynamically generated by CGI or PHP) and so I am using libxml2 wit...

Axis2 and fastinfoset - cannot get content-type to change

I've been trying to enable fastinfoset compression on my web services. However, I'm having a problem getting the content-type to change on the request from the client. At least, I think that's why it's not compressing. I've tried a lot of different things, but the content-type always remains "text/xml". I'm pretty sure that it's suppo...

Enable PHP to read .css and .js files while keeping their original Content-Type

Hi all, I would like to configure apache php5 in a way that .css and .js files will be inspected by php their content type will remain as default (that is respectively "text/css" and "application/x-javascript") I need this because both CSS and JS files are using global PHP vars. This allows me from a single PHP file to control both ...

How does web server detect Content-Type for a response document?

I have 2 identical xhtml-documents which are in html (1st) and xhtml (2nd) extensions. The difference is in extension only. Using ajax (jQuery 1.4.1) I try to get 1st, but web server (IIS 5.1) sends response with Content-Type: text/html instead of application/xhtml+xml. If I try to get 2nd, there are no problems. For both documents I ...