javascript - How to set boundary while using XmlHttpRequest and FormData -


Using the form data to post the XMLHPRAEVevo, I am trying to set the threshold correctly:

  xhr.open ("post", url); Xhr.setRequestHeader ("content-type", "multipart / form-data; limit = ..."); Var formatta = new form data (); FormData.append ("filename", inputId.files [0]); FormData.append (...); Xhr.send (formData);   

How do I get to set limits in the request title? I was being requested, the border was made in some way in the request. But how can the server be interpreted?

Do not just set the content-type manually header and browser automatically "multipart / form-data; Boundary = ... "value.

If you are using jQuery, set the contentType option to false:

  $ Ajax ({url: url, type: 'post', data: form data, process data: wrong, content type: wrong});    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -