Somehow I doubt you wanna append a textarea, so replace that with the real element you want to append ()...and append it to the formm... So if your html looks like this..
<form id="files" action="" method="">
<textarea></textarea>
</form>
Then the code will be...
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<input type="text" name="photo[]" />').val(file.name).appendTo('#files');
});
},
Or try this...
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<input type="text" name="photo[]" value='+file.name+'/>').appendTo('#files');
});
},