PDA

View Full Version : [4.0.2]File upload tow bugs ?



iZero
13 Jun 2011, 1:19 AM
1.I have a filefield in form.
When I submit the form and server return errors.
I has selected the file will be invalid, the server is not available when I would submit the form,again.
I need to re-browse a file to upload.
Bugs?

2.on upload a file ,when I submit the form. My Server return {"success":false,"msg":"has a error!"}
but Ext has error:

Uncaught Ext.Error: You're trying to decode an invalid JSON String: <pre style="word-wrap: break-word; white-space: pre-wrap;">{"success":false,"msg":"has a error!"}</pre>
why?

calinseciu
13 Jun 2011, 3:18 AM
#2
Please read the documentation http://docs.sencha.com/ext-js/4-0/#/api/Ext.form.Basic-method-hasUpload
You have to use Content-Type: text/html when you're sending a json response from the server.