var AwesomeUploaderInstance1 = new AwesomeUploader({
title:'Ext JS Super Uploader'
,renderTo:'container1'
,frame:true
,width:500
,height:300
});
var AwesomeUploaderInstance2 = new Ext.Panel({
title:'Awesome Uploader via xtype'
,renderTo:'container2'
,frame:true
,width:500
,height:200
,items:{
xtype:'awesomeuploader'
,gridHeight:100
,height:160
,listeners:{
scope:this
,fileupload:function(uploader, success, result){
if(success){
Ext.Msg.alert('File Uploaded!','A file has been uploaded!');
}
}
}
}
});
Configuration | Default Value | Description |
awesomeUploaderRoot | '' | Path to all awesomeuploader resources. This is added to beginning of the path of all resources. |
maxFileSizeBytes | 3145728 (3 MiB) | Maximum file size in bytes |
extraPostData | { } | Object of additional post data to send along with upload |
NOTE: For drag and drop uploads, extraPostData only works in Firefox 3.6+, and the not-yet-released Chrome 6. WHY? multipart/form-data uploads (required to add additional parameters) requires the File API, which is only supported by Firefox 3.6 currently. | ||
xhrSendMultiPartFormData | false | Send multipart/form-data uploads for drag and drop rather than sending the file as the entire request body. Only Firefox 3.6 compatible. See above note. |
xhrFilePostName | 'Filedata' | Name of post parameter for drag and drop file upload. Only used if xhrSendMultiPartFormData=true. See above note. |
supressPopups | false | Do not show built-in popups like "This file is too big" or "Error uploading file". |
flashButtonHeight | '22' | Height of flash button |
flashButtonWidth | '56' | Width of flash button |
flashButtonSprite | 'swfupload_browse_button_trans_56x22.PNG' | Sprite used for flash button |
flashUploadFilePostName | 'Filedata' | POST variable name for flash name |
flashSwfUploadPath | 'swfupload.swf' | path to swfupload.swf file |
flashSwfUploadFileTypes | '*.*' | File name mask for file types allowed by swfupload |
flashSwfUploadFileTypesDescription | 'All Files' | Description of above mask |
flashUploadUrl | 'upload.php' | URL that swfupload should send file to |
gridWidth | 420 | grid width of file list |
gridHeight | 200 | grid height of file list |
iconStatusAborted | 'cross.png' | icon for aborted status |
iconStatusDone | 'tick.png' | icon for done status |
iconStatusError | 'cross.png' | icon for error status |
iconStatusPending | 'hourglass.png' | icon for pending status |
iconStatusSending | 'loading.gif' | icon for sending status |
standardUploadFilePostName | 'Filedata' | POST variable name for standard uploader |
standardUploadUrl | 'upload.php' | URL that stanard file upload should send file to |
xhrFileNameHeader | 'X-File-Name' | Header name used to send file name for drag and drop (XHR2) upload |
xhrUploadUrl | 'xhrupload.php' | URL that drag and drop (XHR2) upload should send file to |
fileupload | Fired after an upload succeeds or fails |
fireEvent(Object thisUploader, Bool uploadSuccessful, Object serverResponse) Bool uploadSuccessful - indicates success or failure of upload Object serverResponse - response from server. will at minimum have a property "error" if an error occurs | |
fileselectionerror | Fired if a file a selected file is larger than the maxiumum allowed |
fireEvent(String message) "message" will be 'File size exceeds allowed limit.' if drag and drop is the source, or if the File API is available on the standard upload field. This also fires if the swfupload "file_queue_error_handler" is called. Possible error messages from swfupload include: 'QUEUE LIMIT EXCEEDED' 'FILE EXCEEDS SIZE LIMIT' 'ZERO BYTE FILE' 'INVALID FILETYPE' |