content-type

How can I *prevent* Apache2 from setting the Content-Type header?

I have a CGI script that prints the following on stdout: print "Status: 302 Redirect\n"; print "Server: Apache-Coyote/1.1\n"; print "Location: $redirect\n"; print "Content-Length: 0\n"; print "Date: $date\n\n"; Where $redirect and $date are reasonable values. What Apache2 actually sends also includes a Content-Type: header (text/plain...

How can I set the default value for a custom "Number" field in SharePoint?

I created a custom field for a content type I am creating using the XML below. <Field ID="{GUID}" Required="False" DisplayName="Likes" Name="Likes" Type="Number" SourceID="http://schemas.microsoft.com/sharepoint/v3"&gt;&lt;Default&gt;0&lt;/Default&gt;&lt;/Field&gt; The field is meant to be used as a counter of sorts, and will be incre...

Determining a Local File's Mime Type (Content-type) With PHP

I am trying to determine a file's mime type. I've tried a few methods, but haven't come up with anything that gives consistent output. I've tried $mime = mime_content_type($file) and $mime = exec('file -bi ' . $file). I am serving up images, CSS, and JavaScript. Example mime_content_type() output: jquery.min.js - text/plain editor....

ASP.NET Create zip file for download: the compressed zipped folder is invalid or corrupted

string fileName = "test.zip"; string path = "c:\\temp\\"; string fullPath = path + fileName; FileInfo file = new FileInfo(fullPath); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.Buffer = true; Response.AppendHeader("content-dispositio...

Content-type not working in PHP

Hi everyone, I have some issues with a PHP file that is not working properly. The Content-type does not get recieved by any browser at all. Firebug interprets the file as text/html instead of css. Here's the file : <?php header('Content-Type: text/css; charset=UTF-8'); error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 'On');...

Sharepoint: Customizing the office dialog "choose document type"

Hi all When saving documents to a Sharepoint document library having multiple content-types, office asks which content-type should be used: Is there a way to customize this dialog to some degree? I have seen that UI elements within Office such as the sharepoint document information panel can be customized using infopath. Is there a ...

Download office document without the web server trying to render it

I'm trying to download an InfoPath template that's hosted on SharePoint. If I hit the url in internet explorer it asks me where to save it and I get the correct file on my disk. If I try to do this programmatically with WebClient or HttpWebRequest then I get HTML back instead. How can I make my request so that the web server returns th...

Overriding content_type for Rails Paperclip plugin

I think I have a bit of a chicken and egg problem. I would like to set the content_type of a file uploaded via Paperclip. The problem is that the default content_type is only based on extension, but I'd like to base it on another module. I seem to be able to set the content_type with the before_post_process class Upload < ActiveRecor...

Documenting and defining content types for a CMS or similar project

I'm writing up some documentation on a Drupal project and my task is to define the content types and their attributes. The intended audience is project managers and developers. So it could be a high level document that gives an overview of the system. (I think that's how I describe it: high level rather than high detail) At the moment I...

SharePoint: How to programatically reorder fields in a custom content type?

This is the code I wrote to reorder fields in a custom content type: //get the content type SPContentType listContentType = myList.ContentTypes[MyContentTypeName]; //get the field name to put first string firstFieldName = myList.Fields[FirstFieldDisplayName].InternalName; //get all field names in the content type List<string> fieldNames...

data format encoding and etc

Hi: I Suddenly found that I have no idea about the concept of data format and the encoding. For exmpale, what is the differences about the ascii/binary/base64/text-xml ? For a real case, I am working with a web service whose parameter I have to define,however one of the parameter should be ascii,another is binary and the last is netcdf....

Firefox fails to detect content type set by PHP

Hi all, I want a php page to 'display' a pdf. Here is the code: <?php header("Content-type: application/pdf"); readfile('Reportage - Berlin.pdf'); //tried echo(readfile(...)) as well ?> Not very complicated I think, but somehow firefox cant detect that this is a pdf. This works in Safari but in firefox, i get a prompt to download...

Amazon S3 is not serving files correctly.

I made this site for my friend and I uploaded it to an Amazon S3 bucket (http://ballard26.s3.amazonaws.com/index.html) and when I go to that site the page doesn't load correctly and I have no idea why. Any ideas? For example, the stylesheet.css doesn't load correctly. If you go to http://ballard26.s3.amazonaws.com/stylesheet.css, it dow...

Setting the content-type of requests performed by jQuery jqGrid

I am using the latest version of jqGrid: 3.6.4 This seems like a simple problem (or at least it did before I spent a few hours on it): When the grid sends a request to the server (to a controller action), its content-type is always: application/x-www-form-urlencoded; charset=UTF-8 and I would like it to be: application/json; charse...

How do I get CAML for a custom content type

I am trying to get the CAML for a custom content type that I am creating. What I am really doing is creating the content type in Visual Studio 2010 via CAML and then deploying that content type to my sandbox using the new deploy features in VS 2010. At that point, I am modifying the content type using the SharePoint interface (i.e changi...

Get foreign key in external content type to show up in list view

I have come across blogs about how to setup an external content type (e.g. http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/02/02/it-s-easy-to-configure-an-external-list-with-business-connectivity-services-bcs-in-sharepoint-foundation-2010.aspx) but I have not seen any examples of what to do when your external SQL DB has f...

Resource interpreted as other but transferred with MIME type text/html.

I'm transferring fragments of HTML via Ajax. Safari (4.0.5) reports: "Resource interpreted as other but transferred with MIME type text/html." The file name of the file I get has a .html extension. The server does set the header for this: Content-Type:text/html As I said, the content is a fragment of HTML, which is injected into the ...

Making JSP page not set the response content-type

Is it possible to make JSP pages not set any content type on response? In my setup, JSP doesn't directly generate the response, but rather an intermediate presentation, which is then processed by additional Java code that creates HTML or JSON based on that. So, can I somehow make JSP not set content-type on the response and leave it to...

Getting content-type for a file in ObjectiveC

Hi All, How to get the Content-Type for any file in ObjectiveC ? I can then set the "Content-Type" header while sending the file to any web server. Thanks ...

Is there a java library equivalent to file command in unix

Is there any java library that is similar to unix's command file? ie: $ file somepicture.png somepicture.png PNG image, 805 x 292, 8-bit/color RGB, non-interlaced The file command is such a nice tool. I need something that can tell me if the file is really what I want it to be. (ie a picture, document etc) I know I can run the comm...