2

I'm having to communicate with a custom back-end at the moment, which is only accepting an encoding type of "multipart/html". I wanted to see if there was an easy way of submitting data to the server via the Ext.Ajax class but with custom encoding?

I've tried:

Ext.Ajax.request({
  ...
  enctype: 'multipart/form-data',
})

and also

Ext.Ajax.request({
  ...
  extraParams: {
    enctype: 'multipart/form-data'
  }
})

Neither of which worked.

Anton Babushkin
  • 406
  • 2
  • 12

1 Answers1

0

Use headers: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.proxy.Ajax-cfg-headers

Add something like:

...
headers: [{ Content-Type: 'multipart/form-data' }]
...

Note: I've never used something like this myself. I just looked through Ext.data.proxy.Ajax source code and found that they use this property to pass it inside the request() function. Documentation is somewhat laconic on this - so you might end up trying couple different things.

sha
  • 17,824
  • 5
  • 63
  • 98