View Full Version : File Upload problem

6 Oct 2010, 5:39 AM

I'm trying to implement file upload in my web application.
I have followed api documentation and used FileUploadField extension.
Here is my code:

this.fieldUploadMan.add(new Ext.ux.form.FileUploadField({
emptyText: 'Select .tar file',
fieldLabel: 'File name',

xtype: 'button',
text: 'Upload',
type: 'submit',
width: 150,
waitMsg: 'Uploading...',
success: function(form, action) {
Ext.Msg.alert('Success', action.result.msg);
failure: function(form, action){
Ext.Msg.alert('failure', action.failureType+ ' , '+ action.response+' , '+ action.result);
This is only a subset of my code:
this=reference to Ext.Panel main container
this.fieldUploadMan=reference to Ext.form.FieldSet
this.panWebLct=reference to Ext.form.FormPanel

The problem is that the server response is in HTM format as follows:

<br><h1> MACHINE NOT LOGGED </h1> <br>WEBS: upload DISCARD file "Webs_17_N96103_1.2.0b7.tar" ( 1874 bytes ) <br>WEBS: accepted file: "webs_18_XXX.tar"
</html>When Ext try to decode the response fall in syntax error.
There is any mode to avoid decoding the response because I don't need it.
What I need is to get the HTTP response code, for example 200,500,506
I can't modify the server response because is third part software.

Sorry for my school Eglish

Thank in advance

6 Oct 2010, 5:47 AM
You could define a very simple error reader, e.g.

errorReader: {
read: function(response){
return {success: true}; // or false based on the response

6 Oct 2010, 6:15 AM
The responseXML of the pseudo XHR passed to the reader should contain the HTML document.

The reader should be able to make sense of it.