How to set jQuery ajax response as input type="file"
value for updation purpose?
Here I get question response as byte[]
array. How do I set this to file type?
JS
$.ajax({
type: 'POST',
url: 'viewQuestion.html',
data: ({
questionId: id
}),
success: function(responseData) {
$('#updateQstn').val(responseData.question);
}
});
HTML
<input type="file" value="Browse" name="updateQstn"
accept="image/*" id="updateQstn" />