Quick Links
ASP.NET File Upload Progress -
OnClientProgressRefreshed
function
If
OnClientProgressRefreshed
server-side property is set to some client-side function, this function is called with one parameter.
This parameter is an object that has the following properties:
Properties
SETTINGS
RequestSize
numeric
. The total size of sending request (on upload) in bytes.
Bytes
numeric
. Number of currently uploaded bytes.
FilesCount
numeric
. Number of currently uploaded files.
CurrentFileName
string
. Name of currently uploading file.
UploadedList
string
. String with currently uploaded file items (delimited with
"\n"
character).
Every such item is a string with uploaded file name, its size in bytes and possibly maximum allowed file size (delimited with
"/"
character).
If maximum allowed file size is present in this item, it means that this file was rejected because of its too large size.
Sample
<%
@
Register
TagPrefix
="fup"
Namespace
="OboutInc.FileUpload"
Assembly
="obout_FileUpload"
%>
...
<
script
type
="text/JavaScript">
function
Refresh(info)
{
// get element where result of refreshing should be rendered
var
place = document.getElementById(
"RefreshResultPlace"
);
place.innerHTML=
"uploaded "
+info.Bytes+
" bytes from "
+info.RequestSize+
"<br />"
+
"uploading file name: <span style='color:#0000FF'>"
+info.CurrentFileName+
"</span><br />"
;
if
(info.UploadedList.length > 0)
{
var
table = document.createElement(
"TABLE"
);
table.border =
"0"
;
table.cellPadding =
"0"
;
table.cellSpacing =
"0"
;
place.appendChild(table);
var
arr = info.UploadedList.split(
"\n"
);
// get array of file items
for
(
var
ind
in
arr)
{
var
item =arr[ind].split(
"/"
);
// get file item array
var
row =table.insertRow(table.rows.length);
var
cell;
var
str;
cell=row.insertCell(row.cells.length);
cell.innerHTML= item[0];
// file name
cell=row.insertCell(row.cells.length);
str =
"<span style='color:#0000FF'> "
;
str+=
(item.length >2)?
"rejected"
:
"uploaded"
;
str +=
"
</span><br/>
"
;
str += item[1]+
" bytes"
;
// file size
// insert maximum allowed size if file was rejected
if(item.length >2) str +=
" >
"
+item[2]+
" bytes"
;
cell.innerHTML= str;
}
}
}
</
script
>
See also working example
Client-side events handling
.
obout.com
obout.com Home
File Upload Progress Home
File Upload Progress Home
Download
Site Map
Examples
- 17
Default settings
Show uploaded files names
Client-side events handling
Another style
Localization
Custom time format
Preserve space
Allowed file extensions and sizes
StatusPanel
control use
Add/delete file inputs
Cancel data transmitting
Customize
- 2
Custom style file
Custom localization file
Configuration
- 4
obout_FileUpload DLL
Web Configuration
- 3
UploadProgressModule
UploadProgressHandler
Optional settings
Knowledge Base
- 1
Knowledge Base
Documentation
- 5
Server side properties
Client side interface
- 3
OnClientProgressRefreshed
OnClientFileCleared
OnClientFileRejected
Upload large files
ChangeLog
ASP.NET 2.0-4.0
AJAX Page
Calendar
Color Picker
Date Picker
File Upload Progress
Flyout
Grid
HTML Editor
Image Zoom
Listbox
Multilevel Listbox
Show
Spell Checker
Splitter
Super Form
Tab Strip
TreeView
Tree_DB
Window
Menu
Context Menu
Easy Menu
Slide Menu
Text Menu
Combobox
Combobox
AJAX Autosuggest
Multilevel Combobox
State Selector
Interface Controls
Button
Checkbox
Dropdown List
Multiline Textbox
Radio Button
Textbox
ASP.NET 3.5-4.0
Color Picker
File Upload
HTML Editor
Spell Checker
TreeView
ASP.NET MVC
Combobox
HTML Editor
Interface Controls
Listbox
Multilevel Combobox
Multilevel Listbox
State Selector
Download
Suite for ASP.NET
Customer log-in
Support
Knowledge base
Contact support
Install FAQ
Mailing list
Compare versions
Purchase
Purchase page
Contact Sales
License info
Terms of use
Company
Testimonials
Clients
About us
Contact us