Questions tagged as 'formdata'

2
answers

Upload upload files with AJAX

I am not able to send some upload files with AJAX. I need to send 3 files with dynamically generated inputs, so I did not use the multiple attribute. By firing the event, I get to the xhr.send (files), which does not "play" the PHP file. C...
asked by 14.10.2016 / 23:54
1
answer

FormData is putting the string "null" for null values

I'm using a library called ngUpload . In it we have the option to send the data along with the upload of a certain file. I'm doing this upload as follows: Upload.upload({ url: '/orcamento/ajax-criar', data: {cliente: $scope.c...
asked by 25.01.2017 / 17:16
1
answer

How to remove a field already added to a 'FormData'?

The following code inserts files from a file field, into a FormData : var filedata = event.target; // FileList object var i = 0, len = filedata.files.length, file; for (; i < len; i++) { file = filedata.files[i]; //...
asked by 05.01.2014 / 00:29
1
answer

Why do I have to use FormData to send files via Ajax?

I created an HTML page with a form, and in it a imput file and a hidden field, all of them with the name attribute. <form id="meuForm" action="..." method="POST"> <input type="hidden" name="itemId" value="1" /> &...
asked by 06.09.2016 / 22:08
2
answers

Easiest way to transform request into FormData

this.getArray = function(callback){ $http({ method: "post", url: "index.php?modulo=ClientesOnline&acao=getClientes", headers: {'Content-Type': 'application/x-www-form-urlencoded'}, data: $.param({ajax:1}),...
asked by 23.08.2016 / 20:31
1
answer

Retrieve model list passed by ajax through FormData

I am sending an image, along with a model in which it contains a list of integers. But I can not recover when I enter the Action. I can retrieve the image, field1 and field2, the field fieldList is left blank. HTML <input type="file...
asked by 28.11.2018 / 20:40
1
answer

Display values adding to the FormData object and remove

I have often tried to debug an instance of the FormData object, but I can not see the values stored by the append method. I tried this: f = new FormData(); f.append('name', 'Wallace Maxters'); f.append('image', $('#file').pr...
asked by 01.06.2015 / 19:56
1
answer

Pass parameters (including an image) to PHP with Axios using formData

I created a React component to be my custom input button: getFormData(){ var formData = new FormData(); var imagefile = document.querySelector('#btn_file_logo'); formData.append("image", imagefile.files[0]); return formData; }...
asked by 06.06.2018 / 16:01
1
answer

Empty textarea post with jquery ajax and formdata

I have a form that uses Ajax to do the POST in PHP and make the insertion in the database to get the data I use FormData however the textarea inserts empty in the bank. <script type="text/javascript"> function submitForm() { var myFo...
asked by 12.12.2017 / 00:42
1
answer

Separate Data from Multiple Forms with FormData

Would you like to submit some forms at the same time with FormData ? For example, each product will have sizes and images. I would like to separate each product in an array and send it to the PHP page at the same time, so I can go through th...
asked by 09.04.2018 / 15:05