content-type

Is there an enum for the ContentType property on a HttpWebResponse ("text/plain", "application/octet-stream" etc.)?

The closest thing I could find was System.Net.Mime.MediaTypeNames but that doesn't seem to have everything (like json) since it seems to be more focused around email attachments. ...

ContentType doesnt work, mime=application/octet-stream

In C# i am doing context.Response.ContentType = "image/png"; context.RewritePath(sz); context.Response.ContentType = "image/png"; It seems to redirect the path as i can see see images on my pages. However in firefox when i right click and select "view image" i get a download. Using this c++ code i c...

Browser fails to recognise Content Type header correctly

I have an issue with my browser failing to recognise the content types I am sending in my responses and trying to download the file instead of displaying it. I have a generic handler (named SPARQL.ashx) written in ASP.Net which does some work and produces an object which is of two possible types. Either it gets a SPARQLResultSet or a...

How do you send raw headers in ruby

I have a page which uses the UTF-8 character set, however the characters are mangled on the page, I think this is just a matter of setting a header "Content-Type: text/html; charset=utf-8" ... I know how to do this in PHP, simply place the following at the top of the page. <?php header("Content-Type: text/html; charset=utf-8"); ?> Is ...

Updating already-deployed SharePoint content types to handle additional item events

I have a site content type that was used for a handful of lists throughout my site collection. In that content type, I describe an event receiver to handle the ItemAdding event. This works fine. Now I need to update the content type so that ItemUpdating is also handled. OTTOMH, I tried simply modifying the xml for my content type, si...

How to make my PHP Socket Server send a policy file to flash clients?

My flash game needs to connect to my PHP Socket Server. Because of security things, a policy file has to be send to the flash client when it tries to connect. The following is what I've done. In Actionscript / Flex 3 / Flash: Security.loadPolicyFile("http://[SERVER.IP]:9000/crossdomain.xml"); socket.connect(hostName, port); //connect ...

IE7 and XMLfiles on file system

I'm loading a XML file via Ajax using jQuery. For my tests, I use a file on my file system. It seems all is fine in other browsers but the response headers got by IE has no content-type header. So I get a parsererror. (The XML is valid, I checked it (twice).) How can I bypass this problem ? ...

MOSS 2007 Content Types - farm wide application

We have an issue with rolling out content types with features. How does one roll them out to the SharePoint farm and update the database at the same time. Right now, we cannot figure it out. Is there something that has to be done custom? ...

Is it possible to download a binary file from JSP?

I think is it quite possible, but I'm not sure. I don't have the possibility to use servlet directly, so I'm forced to use JSP ( long history, short time, you don't want to hear ) So I think something like the following will do: // PSEUDO-CODE: // source.jsp Download your file <a href="file.jsp?xyz">MyDocument.doc</a> // file.jsp ...

Deleting a Content Type in SharePoint

I'm trying to delete a content type from SharePoint, but it keeps giving me the message: "The content type FOO BAR is part of an application feature." I have deactivated the feature, retracted the solution and deleted the package from the solution store, the content type is not in use by any lists (I followed the method here), there are ...

.aspx page dedicated to respond to ajax requests, how to set content type

Hi, I am creating a .aspx page to respond to ajax requests. If I return json back, how do I set the content type so my calling page receives the JSON properly? I'm using jquery if that matters. ...

Decoding HTML entities with Python

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out what I am doing wrong. Take for example: "U.S. Adviser&#8217;s Blunt Memo on Iraq: Time &#8216;to Go Home&#8217;" I've tried BeautifulSoup, decode('iso-8859-1'), and django.utils.encoding's smart_str without any success. ...

Sharepoint : Find a list based on a content type in a web part?

Is it possible to find, in a Web Part, if a list is made from a specific content type? Or, find all lists that are from a specific content type would do the trick too! ...

How to return the correct content-type for JSON in CakePHP?

Hi, I'm trying to set the content-type header for a JSON response accessed with an AJAX GET request. I've followed tutorials on blogs and the bakery but I always receive 'text/html' back from CakePHP. How do I set the content-type header correctly? Here's my code at the moment: http://bin.cakephp.org/view/668011600 Any help would be ap...

Different action depending on returned content type in jquery ajax

Hi, Is there any way I can evaluate the returned content type of a jquery ajax request and do different things depending on the content type? For example if the conten type is html I'd like to append this to a certain div on my page. If the content type is text/javascript I'd like to just evaluate the javascript. If the content type is...

SharePoint Web Services - Updating ContentType field Required property?

I've been trying to programmatically reproduce the behavior of editing a Content Type's field properties in the SharePoint site management screen and selecting the "Required" radio button with no sucess using the WSS 3.0 web service's Webs.asmx "UpdateContentType" method. The first difficulty was the issue with the MSDN documentation th...

How to get the content-type of a file in PHP?

I'm using PHP to send an email with an attachment. The attachment could be any of several different file types (pdf, txt, doc, swf, etc). First, the script gets the file using "file_get_contents". Later, the script echoes in the header: Content-Type: <?php echo $the_content_type; ?>; name="<?php echo $the_file_name; ?>" How to I set...

opening a *.bat file in a popup window in IE

I need to open a *.bat file in a popup window. The way i do that is i open the popup window, which has a url set to the action of the downloading service. The downloading service returns the following headers: 192.168.000.195.08080-192.168.000.201.52131: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Disposition: inline; filename="v...

How do you ask an external program to open a file being served through a web browser? What about detecting if the external program is installed?

Hello Folks, I have a two part question. The first I think I have an okay answer to.... I am looking to force an external program to be called up to view a configuration file for an application my company is working on. The basic gist I guess is to set the Content-type header to type that your application is associating with, and then ...

Renaming Title Column in SharePoint List Definition

I am defining a custom list content type for SharePoint (using VSeWSS 1.3 and schema.xml). I want to change the display name of the default title field ('Title') to 'Serial Number': <Fields> <Field Name="Title" DisplayName="Serial Number" Type="Text" /> </Fields> I am using the LinkTitle column in my definition of the default view ...