Flash upload progress bar problem

Posted on 2008-10-19
Last Modified: 2013-11-11
I have problem with my flash upload progress bar. It works perfectly on localhost. But when i upload it on server, the progress bar doesn't work correctly. Please help me.
Here is my demo:

var reference:FileReference = new FileReference();

var listener:Object = new Object();

//server script

var scriptLocation:String = 'uploader.php';

var progressBarHeight:Number = 10;

var progressBarY:Number = 50;

var progressBarColor:Number = 0x66ccff;

uploadButton_mc._visible = false;

chooseButton_mc.onRelease = choose;

uploadButton_mc.onRelease = uploadCurrent; //upload file

function choose():Void {

	reference.browse([{description:'All Files (*.*)', extension:'*.*'}]);


function uploadCurrent():Void {

	chooseButton_mc._visible = false;

	progressBar = makeProgressBar(0, progressBarY);



listener.onSelect = function(file:FileReference):Void {

	display_txt.text =;

	uploadButton_mc._visible = true;


listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {


	percent = Math.ceil(bytesLoaded*100/bytesTotal);

    display_txt.text =' - '+ percent +'%';

	progressBar._width = Math.ceil(Stage.width*(bytesLoaded/bytesTotal));

	percent_txt.text = bytesLoaded + "/" + bytesTotal;


listener.onComplete = function(file:FileReference):Void {


	display_txt.text = '';

	uploadButton_mc._visible = false;

	chooseButton_mc._visible = true;


//attach Listener to the FileReference Object



function makeProgressBar(x:Number, y:Number):MovieClip {

	var bar:MovieClip = createEmptyMovieClip('progressBar_mc', 0);

	bar._visible = false;


	bar.lineTo(Stage.width, 0);

	bar.lineTo(Stage.width, progressBarHeight);

	bar.lineTo(0, progressBarHeight);

	bar.lineTo(0, 0);


	bar._width = 0;

	bar._visible = true;

	bar._x = x;

	bar._y = y;

	return bar;



Open in new window

Question by:jmccar68
  • 3
  • 2

Expert Comment

ID: 22752627
Just uploaded a couple of test files (so you might to delete them) but the process worked fine, file size was correct and completed at 100%


Author Comment

ID: 22754590
I'm using Firefox 3.0 and when i upload a file, the progress bar goes to 100% even my file isn't uploaded.
Please help me!

Accepted Solution

Sci-Fi-Si earned 500 total points
ID: 22756068
Which type of code are you using to upload this file, is it flash, php or other.
Have a look at your uploader.php file and confirm which directory the file is being uploaded to. The transfer looks ok, the byte count as the upload takes looks ok, I strongly suspect its the directory.

Do you have the same problem if you try uploading locally?

All the best
Sci-Fi Si

Author Comment

ID: 22756473
Thank you Sci-Fi-Si,

I tried uploading with another computer, and it works correctly. Only when i upload using my pc, the problem occurs.
I attach my screen shot below. And here is my source

Expert Comment

ID: 22756836
Glad I could help

All the best
Sci-Fi Si

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
3D rotation for a product 3 331
Adobe Media Server Or Encoder Broken Affer Static IP Change 4 156
blocked plugin flash 5 107
File drag and drop 6 127
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now