PDA

View Full Version : multipart/form-data from forms.js



16 Apr 2007, 4:36 PM
How do i get the form to be setup as multipart/form-data?
var simple = new Ext.form.Form({
labelWidth: 150, // label settings here cascade unless overridden
url:'videos.php',
method: 'post',
fileUpload: true,
baseParams: { enctype : 'multipart/form-data'},
reader : new Ext.data.XmlReader({
record : 'simple',
success: '@success'
}, [
'agree', 'isover18', 'modelname', 'dob', 'address1', 'address2', 'city', 'state', 'zip', 'uploadfile'
])
}); no workie.

Animal
16 Apr 2007, 11:22 PM
It's not a parameter, it's an attribute of the form.

You'll have to send an autoCreate config option with a DomHelper spec to create a form with enctype:'multipart/form-data'

I think the Ext form should add this if config.fileUpload is true. Jack what do you think?

18 Apr 2007, 9:43 AM
It's not a parameter, it's an attribute of the form.

You'll have to send an autoCreate config option with a DomHelper spec to create a form with enctype:'multipart/form-data'

I think the Ext form should add this if config.fileUpload is true. Jack what do you think?


i ended up fixing it by grabbing it off of the dom and setting el.encode = "multipart/form-data".