Click here to Skip to main content
13,005,198 members (58,358 online)
Click here to Skip to main content
Add your own
alternative version


4 bookmarked
Posted 4 Sep 2012

Simple Flash Uploader

, 28 Feb 2013
Rate this:
Please Sign up or sign in to vote.
A simple and easy way to implement uploading file with progress info to an ASP.NET page.


After spending some time searching the web for code to find uploading progress, I wrote this simple and easy to implement article based on a code library from 

Using the code

To start, just follow these few steps:

  1. Use the library JavaScript codes included in the article:
  2. <script type="text/javascript" src="plugins/swfupload.js"></script>
    <script type="text/javascript" src="plugins/swfupload.queue.js"></script>
    <script type="text/javascript" src="plugins/fileprogress.js"></script>
    <script type="text/javascript" src="plugins/handlers.js"></script> 
  3. Then include the following code block in your code as:
  4. <script type="text/javascript">
        var swfu;
        window.onload = function () {
            var settings = {
                flash_url: "flash/swfupload.swf",
                upload_url: "Default.aspx",
                post_params: { "PHPSESSID": "" },
                file_size_limit: "100 MB",
                file_types: "*.*",
                file_types_description: "All Files",
                file_upload_limit: 100,
                file_queue_limit: 0,
                custom_settings: {
                    progressTarget: "fsUploadProgress",
                    cancelButtonId: "btnCancel"
                debug: false,
                // Button settings
                button_image_url: "images/TestImageNoText_65x29.png",
                button_width: "65",
                button_height: "29",
                button_placeholder_id: "spanButtonPlaceHolder",
                button_text: '<span class="theFont">Choose File</span>',
                button_text_style: ".theFont { font-size: 12;font-family:tahoma }",
                button_text_left_padding: 12,
                button_text_top_padding: 3,
                // The event handler functions are defined in handlers.js
                file_queued_handler: fileQueued,
                file_queue_error_handler: fileQueueError,
                file_dialog_complete_handler: fileDialogComplete,
                upload_start_handler: uploadStart,
                upload_progress_handler: uploadProgress,
                upload_error_handler: uploadError,
                upload_success_handler: uploadSuccess,
                upload_complete_handler: uploadComplete,
                queue_complete_handler: queueComplete	// Queue plugin event
            swfu = new SWFUpload(settings);

    All files and options are fully described here. The most important one is upload_url that provides the sample code. It indicates the page that posts the progress.

  5. Finally the server side code in the VB.NET sample:
  6. Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        For Each file As HttpPostedFile In Request.Files
            file.SaveAs("~/Videos/" & file.FileName)
    End Sub


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Iran (Islamic Republic of) Iran (Islamic Republic of)
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

QuestionWhere is the swf code Pin
febpriv8-Mar-13 9:54
memberfebpriv8-Mar-13 9:54 
QuestionWhere is the Source Code ? Pin
khaldoon.sss2-Mar-13 18:49
memberkhaldoon.sss2-Mar-13 18:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170627.1 | Last Updated 28 Feb 2013
Article Copyright 2012 by M.Ardekanian
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid