Right time to refreshing page

Jul 11, 2009 at 6:29 PM

Hello, can anyone help me to solve me issue.

I created custom adapter which makes thumbnail, saves original file and thumbnail into file system and updates database. Uploaded files have to be shown in the GridView right after uploading and processing. The question is: When do i have to refresh the page?

I tried to use FileStateChanged event as below


 function FileStateChanged(uploader, file, httpStatus, isLast)

{
            Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
            if (file.state > Flajaxian.File_Uploading && isLast)

            {
                window.location.reload(true)
            }
}

but i think it fires too early because page reloads and there are no uploaded files  shown until i press F5.