lightcase icon indicating copy to clipboard operation
lightcase copied to clipboard

sending multipart/form-data to lightcase

Open sashabeep opened this issue 8 years ago • 1 comments

Tried to send form with attach with no success. FormData didn't help me do the trick. How to solve?

$(document).on('submit','form[data-rel=lightcase]', function (event) {
		event.preventDefault();
		var $this = $(this);
		//var formData = new FormData($(this)[0]); <----using this instead of serialize broke the action
		$this.lightcase('start', {
			type: 'ajax',
			href : $this.attr('action'),
			ajax : {
				width : 550,
				type : $this.attr('method'),
				href : $this.attr('action'),
				dataType : 'html',
				data : $this.serialize(), //<--- data sends only text fields
			}
		});
	});

sashabeep avatar May 19 '17 14:05 sashabeep

This must be related to your current settings for ajax. I see that contentType is missing in your example. http://api.jquery.com/jQuery.ajax/

cbopp-art avatar May 20 '17 06:05 cbopp-art