content-type

How to make and check a request with content-type as 'application/json'?

hi all, In my asp.net page I have a webmethod which will return data in json.I would like to run this method only when the http request content-type is 'application/json'.I do not understand how do I make a request with content-type as 'application/json' and how to check if the request content-type is 'application/json'? Please help.. ...

Rails3 renders a js.erb template with a text/html content-type instead of text/javascript

Hi, I'm building a new app with 3.0.0.beta3. I simply try to render a js.erb template to an Ajax request for the following action (in publications_controller.rb): def get_pubmed_data entry = Bio::PubMed.query(params[:pmid])# searches PubMed and get entry @publication = Bio::MEDLINE.new(entry) # creates Bio::MEDLINE object from e...

Custom field not showing in Custom Content Type

Hi all: I created a custom column in a custom content type in a Sharepoint Web manually (e.g. /MySite/MyWeb). I now want to programmatically copy this content type across to another web (e.g. /MySite/MyWeb2). However, upon looping through the custom content type in code, I could only find 2 fields: Content Type and Title (expected: Ti...

Difference between FieldLinks and Field in Sharepoint

Hi all: I'm in the middle of trying to copy a custom content type from one web to another. I've googled around and found some examples that use FieldLinks and Fields. I'm kind of lost as to which one to use, since when I get the FieldLinks from my source web, I get 3 fields; while retrieving from Fields only returned me 2 fields... th...

How to determine MIME Type set by htaccess in PHP

I have a .htaccess file set up to define specific MIME types in directory root/a/b/, and all of the files are in the same directory. I have a php file that wants to serve those files, in directory root/c/, and needs to determine the content-type as defined by the .htaccess file. Is there any way to do this? PHP version is 5.1.6. mime...

Manage views for content types (or add a view to multiple lists)

I'm surprised that I cannot find on the net a solution where I could manage views for content types. Do I really have to visit each task list with my browser to add/modify a view? Is there any solutions available that would allow me to just define a view for content type and thus make this view available on all lists where content type ...

Sending most correct mimetype

Hi all, I have a list of extension to mimetype in a INI file. However some extensions have multiple mimetypes, for example; midi[] = "application/x-midi" midi[] = "audio/midi" midi[] = "audio/x-mid" midi[] = "audio/x-midi" midi[] = "music/crescendo" midi[] = "x-music/x-midi" 6 (possible) mimetypes for 1 extension. Whats common practic...

How to serialize an Object of type System.Net.Mime.ContentType?

I want to parse a text message and store in into an object of type System.Net.Mime.Attachment. The problem comes when I want to serialize this object. Error: Type "System.Net.Mime.ContentType" is not marked as serializable. How can I avoid this? Thanks. ...

Programmatically copying custom content type and columns from one web to another

Hi all: I'm experiencing a very stubborn problem when copying custom content type and its columns from one web to another within the same site. Basically, this is the code that I have: foreach (SPField field in existingWeb.Fields) { if (!destinationWeb.Fields.ContainsField(field.Title)) { destinationWeb.Fields.AddField...

Can JavaScript process binary data?

Admit me describe my questions in situation-oriented way: Assume Internet Explorer is still the dominating web browser (Firefox has document for binary processing): The XMLHttpRequest.responseText or XMLHttpRequest.responseXML in Internet Explorer desire txt or xml/xhtml/html, but what about the server response the xmlHttprequest wit...

xmlhttprequest responsetext coming for Accept header: text/xml , but server error for application/JSON

I have to get response text from a resourceindex page as JSON object. When I dont put a Accept header in the request, it shows me the xml response (i see it in an alert).. But I want the response as a JSON object.. What should I do. One solution would have been httpRequest.setRequestHeader('Accept', 'application/JSON'); but this give...

Content type with workflow and lookup column

Hi All, I have a requirment where I want to upload a document based on category and subcategory. I have added this columns as an lookup column which pulls data from category and subcategory list. Now want the document should be passed from series of approval so I have attached SharePoint out of the box Approval workflow to this document...

Content Types in browsers, can we use the Mime??

I am wondering which mime types are dangerous in browsers to be set as the Content Type, if any?? I am noticing that many forum software, when uploading files, use the application/octet-stream for any files other than images and place that into the Content Type of the header when outputting it. I am wondering why don't they place the a...

Jquery - How to make $.post() use contentType=application/json?

I've noticed that when using $.post() in jquery that the default contentType is application/x-www-form-urlencoded - when my asp.net mvc code needs to have contentType=application/json (See this question for why I must use application/json: http://stackoverflow.com/questions/2792603/aspnet-mvc-why-is-modelstate-isvalid-false-the-x-field-...

Jquery JQGrid breaks when contentType=application/json?

I've had to use $.ajaxSetup() to globally change the contentType to application/json $.ajaxSetup({ contentType: "application/json; charset=utf-8" }); (See this question for why I had to use application/json http://stackoverflow.com/questions/2792603/aspnet-mvc-why-is-modelstate-isvalid-false-the-x-field-is-required-when-that) But t...

Flash object wont load inside the application but loads in separated file.

I have a Flash object that loads fine in a static sample HTML but doesnt inside the application. I saw something interesting in firebug. When the page loads the object is loaded two times. In the first one I get a Partial Response status but the content-type of the package is right. In the second time the whole package is transfered but ...

SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFF (E_UNEXPECTED) in Sharepoint

Hi all: I've been trying to programmatically copy custom content type and its custom columns from one web to another for some time now, and I always get different errors or exceptions every time. After yet more tries, I received more strange and cryptic exception from Sharepoint after clicking onto a newly copied custom column in a cu...

how can a firefox extension detect content-type of the page loaded ?

since my extension's pageload is triggered even when I view css or js files, i want to add another check that triggers my extension only when the current page's content-type is text/html . //eg: at my page load handler function onPageload(){ // only want to proceed if content-type reflects a text/html or */html page if ( contentTyp...

Java (JSP): repeating the contentType header in a "sub-jsp"

What happens when headers are repeated in a .jsp you include in another .jsp? For example if example.jsp starts with this: <?xml version="1.0" encoding="UTF-8"?> <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page"&gt; <jsp:directive.page contentType="text/html; charset=UTF-8" /> <div class="content"> <jsp:include page="s...

Displaying a list of objects with Views - Drupal

Hi folks, I'll briefly explain what I'm trying to do: I need to sort a set of content-types within a paginated page. Also I need to add filtering to the page, for example each content-type should have a set of tags and the filter needs to filter through these tags. This is a basic mockup of what this page consists of: I'm finding ...