Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5966573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:49:08+00:00 2026-05-22T19:49:08+00:00

I have downloaded SWFUpload, in hoping to create the functionality to upload large files

  • 0

I have downloaded SWFUpload, in hoping to create the functionality to upload large files over my website.

I found this guide: http://webdeveloperplus.com/jquery/multiple-file-upload-with-progress-bar-using-jquery/ that I thought I could start from. The difference is that I only want to allow only one image to be uploaded at a time. But I don’t know how to restore SWFUpload after I uploaded a file? I want the queue to be reset and the progressbar to dissapear.

Debug says: SWF DEBUG: Event: uploadError : Upload limit reached. No more files can be uploaded.

Here is my code for SWFUpload:

$(function()
{
    $('#swfupload-control').swfupload({
          upload_url                : "upload-file.php"
        , file_post_name            : 'uploadfile'
        , file_size_limit           : "102400" // 100 MB
        , file_types                : "*.jpg;*.png;*.gif"
        , file_types_description    : "Image files"
        , file_upload_limit         : 1
        , flash_url                 : "js/swfupload/swfupload.swf"
        , button_image_url          : 'js/swfupload/wdp_buttons_upload_114x29.png'
        , button_width              : 114
        , button_height             : 29
        , button_placeholder        : $('#button')[0]
        , debug                     : true
    })
    .bind('fileQueued', function(event, file)
    {
        var listitem='<li id="'+file.id+'">'+
            '<span class="progresstext"><span class="progressvalue"></span> '+file.name+'</span>'+
            '<div class="progressbar"><div class="progress"></div></div>'+
            '</li>';
        $('#log').append(listitem);
        // start the upload since it's queued
        $(this).swfupload('startUpload');
    })
    .bind('fileQueueError', function(event, file, errorCode, message)
    {
        alert('Size of the file '+file.name+' is greater than limit');
    })
    .bind('uploadStart', function(event, file)
    {
        $('#log li#'+file.id).find('span.progressvalue').text('0%');
    })
    .bind('uploadProgress', function(event, file, bytesLoaded)
    {
        //Show Progress
        var percentage = Math.round((bytesLoaded/file.size)*100);
        $('#log li#'+file.id).find('div.progress').css('width', percentage+'%');
        $('#log li#'+file.id).find('span.progressvalue').text(percentage+'%');
    })
    .bind('uploadSuccess', function(event, file, serverData)
    {
        var item = $('#log li#'+file.id);
        item.find('div.progress').css('width', '100%');
        item.find('span.progressvalue').text('100%');
    })
    .bind('uploadComplete', function(event, file)
    {
        // upload has completed, try the next one in the queue
        $(this).swfupload('startUpload');
    })

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:49:09+00:00Added an answer on May 22, 2026 at 7:49 pm

    If you are dealing with upload queues, it is much simpler to use the swfupload.queue plugin

    Then you can bind the ‘queueComplete’ event on your swfupload object, which will be fired once the whole queue has been processed (this is where you would want to hide your progressbar and reset the queue). To reset the queue, this plugin also adds a cancelQueue() function (pay attention as to where you call it though, as it will cancel any on-going upload).

    If you want to cancel it by hand/not use this plugin, you have to cancel the files one by one until the stats() object says it’s empty

    // request your stat objects, it contains amongst others the number of files in the queue
    var stats = my_upload.getStats();
    // while the queue is not empty ...
    while (stats.files_queued > 0) {
      // .. cancel the first in the queue (null: take the first found, false: don't trigger an error event)
      my_upload.cancelUpload(null, false);
      // it is important to reload the stats everytime and not just do a for (i = 0; i < stats.files_queued ...
      stats = my_upload.getStats();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have downloaded LEDA free edition from this website http://www.algorithmic-solutions.com/leda/ledak/index.htm First quetion: I want
I have downloaded the silver light from this http://www.microsoft.com/silverlight// I need to use this
i have downloaded a website using HTtrack wepsite copier. All files are downloaded to
I have downloaded some Office files(doc, xls, pdf etc) on SDcard from FTP server
I have downloaded a freeware photo gallery called Minishowcase (freeware http://minishowcase.net/?main ) to use
I have downloaded the xml dump of the Stack Over Flow site. While transferring
I have downloaded the example code/demo from: http://www.technowise.in/2009/12/uploadify-aspnet-c-vb-examples-demo.html and when I try to run
I have downloaded Netbeans 7.0 beta as I wanted to give the PhpDoc functionality
I have downloaded the Jquery UI with Start theme. Demo is here: http://jqueryui.com/demos/datepicker/ I
I have downloaded and run the Java sound demo available on http://java.sun.com/ . When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.