|
|
Rank: Newbie
Groups: Registered
Joined: 3/9/2006 Posts: 6
|
I want to customize the text displayed by the PercentCompleteText-element in the ProgressElement in the ProgrssAreaTemplate.
First I dont want to display any decimals in the text ("95%" instead of "95.15%").
My page takes some time to process the file after the image is uploaded. When the file is processed the procentage displayed is 100.00%. This is kind of annoying for the users having to wait a long time when the task is 100% completed.
So I want to be able to change the text that is displayed. Maybe show 95% instead of 100% or some other message (like "Wait") instead of 100%.
Is this possible?
Thanks in advance
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
That's not supported currently. However, I'm adding a client side progress handler to the next SlickUpload drop (due out Monday). This should let you do a custom display. If you email me at chrish at krystalware dot com, I'll email you a build as soon as its stable and tested (should be by COB tomorrow).
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
4.0.2 was released today with a client side progress handler. Documentation will be out shortly.
Using the client side event is simple -- set the UploadManager's OnClientProgressUpdate property to the name of a javascript function. That function should take one parameter -- an object that contains all status properties. The following properties are supported:
- currentFile
- currentFileIndex
- fileCount
- fileCountText
- speedText
- timeRemainingText
- timeElapsedText
- contentLengthText
- remainingLengthText
- transferredLengthText
- percentComplete
- state
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/19/2008 Posts: 5
|
We want to limit the size of upload and if it is greater, we want to abort uploading. I think this event would handle it, if I am right. Could you provide a sample on how to use this.
< kw:UploadManager ID="uploadManager" runat="server" OnUploadComplete="uploadManager_UploadComplete" Width="100%" UploadHandlerLocation="UploadHandler.aspx" onClientPorgressUpdate="checksize()">
function checksize(oStatus)
{
}
I don't know what parameter I will be giving in the uploadmanager control
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Are you limiting the size for your entire site? If so, I'd recommend you set the maxRequestLength in the web.config to the max size you accept. The UploadManager control will detect that and abort the upload, giving you a MaxRequestLengthExceeded error status that you can use to display an error message to your user. That is the cleanest way to handle this.
If this doesn't support your scenario, let me know and I'll suggest a different technique.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/19/2008 Posts: 5
|
Is this a client side event I can handle to display the error or server side event. If so which event should I be looking for writing the display error code.
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
It's the UploadComplete event of the UploadManager control - a server side event. The following logic should be what you need:
if (args.Status.Reason == UploadTerminationReason.MaxRequestLengthExceeded) { // Display max request length exceeded error message }
|
|
|
Rank: Newbie
Groups: Registered
Joined: 6/19/2008 Posts: 5
|
I did this but it comes up with the error and cleans the whole form. USer has to reenter all the form for this small mistake in one field?
|
|
|
Rank: Administration

Groups:
Joined: 7/7/2005 Posts: 1,586 Location: Scottsdale, AZ
|
Unfortunately, yes. There is no way to limit the file size in the browser or in javascript, so it must be done server side. Once the form is posted back and the upload is terminated for being too big, the request is lost. The only way around the user having to reenter the form data would be to complete the entire upload and then check the file size after the upload is complete -- not a very good user experience.
|
|
|
|
Guest |