Ajax and Multipart/Form-Data

I am not sure how to set up a form and submit it through a multipart/form-data. I need to be able to upload text and an image at the same time. My form
[php]

SEND SHOUT
function sendShout(form){
$.ajax({ //get public shouts
	type: "post",
	url: "/api/v1/shouts",
	data: form,
	contentType: 'multipart/form-data',
	success: function(data){
		$('#login').remove();
		alert("Congratulations, your shout has been sent!");
	}
});

}[/php]

I’m not jQuery person, but in HTML I would make the change below.

Change:

[php][/php]

TO:

[php][/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service