javascript - jQuery Ajax File Upload -
can use following jquery code perform file upload using post method of ajax request ?
$.ajax({ type: "post", timeout: 50000, url: url, data: datastring, success: function (data) { alert('success'); return false; } });
if possible, need fill "data" part? correct way? post file server side.
i have been googling around, found plugin while in plan not want use it. @ least moment.
file upload not possible through ajax. can upload file, without refreshing page using iframe. can check further detail here
update:
with xhr2, file upload through ajax supported. e.g. through formdata object, unfortunately not supported all/old browsers.
formdata support starts following desktop browsers versions. ie 10+, firefox 4.0+, chrome 7+, safari 5+, opera 12+
for more detail, see mdn link
Comments
Post a Comment