obout
obout.com Home
|
Quick Links
Search
ASP TreeView
Examples
How-Tos and Help
ASP.NET Grid
Examples
Documentation
SlideMenu
Examples
How-Tos and Help
Calendar
Examples
Tutorials
Documentation
Splitter
Examples
How-Tos and Help
Easy Menu
Examples
How-Tos and Help
HTML Editor
Examples
How-Tos and Help
Window
Examples
How-Tos and Help
Purchase
Purchase page
Ordering/Licensing details
Install
Add to VS 2005
Add to project
Support
Contact Us
obout.com
obout.com Home
obout FileUploadProgress
Download
FileUploadProgress home
Working examples
- 9
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
Customize
- 2
Custom style file
Custom localization file
Configuration
- 3
obout_FileUpload DLL
web.config
- 2
UploadProgressModule
UploadProgressHandler
Documentation
- 4
Server side properties
Client side interface
- 3
OnClientProgressRefreshed
OnClientFileCleared
OnClientFileRejected
Change Log
This example demonstrates how to set available extensions and maximum size for uploading files.
Here can be uploaded files with extension
gif
(maximum size
10000 bytes
) and files with extension
txt
of any size.
On submit file
inputs
that contain files with not allowed extensions are cleared and no submit occurs. Client-side function is called after this clearing if
OnClientFileCleared
property of control is set.
Files with size exceeding maximum are
rejected
from HTTP request and server-side does not receive them. Client-side function is called after every such reject if
OnClientFileRejected
property of control is set.
Example code
<
%@ Register
TagPrefix
="fup"
Namespace
="OboutInc.FileUpload"
Assembly
="obout_FileUpload"
%
>
...
<
script
type
="text/JavaScript">
function
Rejected(fileName, size, maxSize){
var
addMessage = (maxSize >= 0)?(
"exceeds "
+maxSize+
" bytes"
):(
"-- session lost"
);
alert(
"File "
+fileName+
" is rejected \nIts size ("
+size+
" bytes)
"
+
addMessage
);
}
function
ClearedFiles(fileNames){
alert(
"Cleared files with bad extensions:\n\n"
+fileNames);
}
</
script
>
...
<
input
type
=file
name
="myFile1"><
br
/>
<
input
type
=file
name
="myFile2"><
br
/>
<
input
type
=file
name
="myFile3"><
br
/>
<
input
type
=submit
value
="submit"
name
="mySubmit"><
br
/>
<
fup:FileUploadProgress
runat
="server"
ShowUploadedFiles
="true"
OnClientProgressStopped
="function(){alert('My custom OnClientProgressStopped event');}"
OnClientFileRejected
="Rejected"
OnClientFileCleared
="ClearedFiles"
>
<
AllowedFileFormats
>
<
fup:Format
Ext
="gif"
MaxByteSize
="10000"
/
>
<
fup:Format
Ext
="txt"
/
>
<
/
AllowedFileFormats
>
<
/
fup:FileUploadProgress
>
See also
Server side properties
,
OnClientFileCleared function
,
OnClientFileRejected function
pages.
Uploaded 
% (
) Total
Uploaded
files
file
from
Uploading file
Last uploaded file
:
Elapsed time:
Estimated time:
Speed:
(Session lost)
rejected
uploaded
Please visit
HOW-TO and Help
page for any questions.
"
Perfect! Honestly, you guys make me look brilliant. Your components offer a dynamic, and professionally designed experience for my users. The TreeView has been invaluable to me, huge datasets and enormous hierarchies are a snap. However, when you first introduced the CALLBACK, you rocked my world! Having moved from desktop to web applications, I missed the functionality I used to have. You gave it back - thank you. I can't tell you the number of times I've been asked "How'd you do that?" (even from our tech support and contractors).
"
John Cappelletti
© Copyright 2000-2008 obout inc. All rights reserved.
Terms of Use
|
Privacy Statement