Thursday, April 25, 2013

SWF File uploader issue fixation in codeigniter - SWF DEBUG: Event: uploadError : IO Error : File ID: SWFUpload_0_0. IO Error: Error #2038

Codeigniter - SWF file uploader issue fixation.

I was spent too much time on fixing a issue of SWF uploader and simply fixed it after a long time.

I was getting the error like

SWF DEBUG: Event: uploadError : IO Error : File ID: SWFUpload_0_0. IO Error: Error #2038

And I fixed it by just changing

upload_url: "",


upload_url : "",

now the whole function will be:

upload_url: "",
file_post_name: 'uploadfile',
file_size_limit : "1024",
file_types : "*.csv",
file_types_description : "Image files",
file_upload_limit : 1,
flash_url : "<?=base_url()?>assets/swfupload/swfupload.swf",
button_image_url : '<?=base_url()?>assets/swfupload/XPButtonUploadText_61x22.png',
button_width : 114,
button_height : 20,
button_placeholder : $('#button')[0],
debug: true
.bind('fileQueued', function(event, file){
var listitem='<li id="''" >'+
'File: <em>''</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>'+
'<div class="progressbar" ><div class="progress" ></div></div>'+
'<p class="status" >Pending</p>'+
'<span class="cancel" >&nbsp;</span>'+
$('li#'' .cancel').bind('click', function(){
var swfu = $.swfupload.getInstance('#swfupload-control');
// start the upload since it's queued
.bind('fileQueueError', function(event, file, errorCode, message){
alert('Size of the file '' is greater than limit');
.bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){
$('#queuestatus').text('Files Selected: '+numFilesSelected+' / Queued Files: '+numFilesQueued);
.bind('uploadStart', function(event, file){
$('#log li#''p.status').text('Uploading...');
$('#log li#''span.progressvalue').text('0%');
$('#log li#''span.cancel').hide();
.bind('uploadProgress', function(event, file, bytesLoaded){
//Show Progress

var percentage=Math.round((bytesLoaded/file.size)*100);
$('#log li#''div.progress').css('width', percentage+'%');
$('#log li#''span.progressvalue').text(percentage+'%');
.bind('uploadSuccess', function(event, file, serverData){
var item=$('#log li#';
item.find('div.progress').css('width', '100%');
var pathtofile='<a href="uploads/''" target="_blank" >view &raquo;</a>';
item.addClass('success').find('p.status').html('Done!!! | '+pathtofile);
.bind('uploadComplete', function(event, file){
// upload has completed, try the next one in the queue


No comments:

Post a Comment