mythz/jquip

does anyone knows how to upload images using jquip? i'm kind of stuck here.

Closed this issue · 2 comments

here is my HTML form code:

<form id="uploadForm" enctype="multipart/form-data">
    <input type="file" id='files' name='file-imgs' ></input>
</form>

and here is my javascript code:

$.ajax({
	url: '/uploadImg_article',
    	type: 'POST',
   	cache: false,
    	data: new FormData($('#uploadForm')[0]),
    	processData: false,
    	contentType: 'multipart/form-data'
})

and....unfortunately , it didn't work. is there something wrong with my code ? or i just using the jquip ajax the wrong way. :/

thanks.

mythz commented

It's not supported, you'll need to use a dedicated ajax upload library like jQuery File Upload or if you're using a Single Page App framework they'll have their own solution for file uploads, e.g. I've had good success with react-dropzone in React Apps.

well , thanks mythz. i know what to do now 👍