2

How can I remove appended data from form Data in Java script? I am using form data for uploading file and passing it to the handler. Code:

var formData = new FormData();
var uploadfiles = $("#ImagesUpload").get(0);
var uploadedfiles = uploadfiles.files;

for (var i = 0; i < uploadedfiles.length; i++)
{
   formData.append('file', uploadedfiles[i]); 
}
Daksh Shah
  • 2,997
  • 6
  • 37
  • 71
shashank
  • 47
  • 1
  • 11
  • i dosent show how can i remove data from formData...if i have apended a imageFile in it How can i remove it... – shashank May 16 '14 at 14:51
  • @vivek_singh The answer in the duplicate says that this is not possible. You have to simply not append date that you do not want to include in the FormData. – Peter Olson May 16 '14 at 15:34

1 Answers1

1

You can't remove data you've appended to a FormData object. There is nothing exposed in the API to allow this. Just create a new FormData.

Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82