# Use of ProgressEvent for upload and FileReference

**URL:** <https://forum.kirupa.com/t/use-of-progressevent-for-upload-and-filereference/259418>\
**Category:** flash\
**Created:** [May 5, 2008, 8:05am UTC](https://forum.kirupa.com/t/use-of-progressevent-for-upload-and-filereference/259418 "2008-05-05T08:05:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitsunegari](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kitsunegari](https://forum.kirupa.com/u/kitsunegari)\
**Post date:** [May 5, 2008, 8:05am UTC](https://forum.kirupa.com/t/use-of-progressevent-for-upload-and-filereference/259418/1 "2008-05-05T08:05:48Z")

</div>

Hi

I have a question concerning the use of ProgressEvent and the upload of files that have a size of 3 or 4 mo ( = files that can’t be uploaded in 1 second or instantly)

I call my function **progressUploadHandler** on the event **ProgressEvent.PROGRESS**

```auto
function progressUploadHandler(event:ProgressEvent)
{

    var pourcentage = Math.ceil((event.bytesLoaded*100)/event.bytesTotal);
    trace(pourcentage);
}

```

What I don’t understand is how is it possible that the variable “pourcentage” reach the value of 100 in 1 or 2 seconds (which would mean the file is 100% uploaded) while the file is not 100% uploaded on the server and still needs a few seconds to be entirely sent.

**1. So, what would bytesLoaded really refers to if I the variable “pourcentage” is equal to 100% whereas it is not entirely sent on the server?**

**2. What property or the event should I call to have the correct value of the data that are really uploaded when I call my function on ProgressEvent?**

Many thanks for your help
