How can I pass file using javascript/jQuery/JSON/Ajax to Insert into database as a blob? -
this question has answer here:
- how can upload files asynchronously? 25 answers
i'm using front-end angularjs, there file upload option. when upload file pass back-end java web services , insert database. flow have do.
my problem is, how can pass file using json ajax web services, please let me know further questions required.
thanks in advance.
ajax doesnt support file uploading. can use formdata fileupload work html5 supported browsers.and if want work older browsers can use iframe form fileupload.
var form = $('form')[0]; var formdata = new formdata(form); $.ajax({ url: 'submitnewsection.html', data: data, type: 'post', success: function ( data ) { alert( data ); } });