SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Customizing PercentCompleteText Options
nizze
#1 Posted : Wednesday, May 28, 2008 12:33:18 PM
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

ChrisHynes
#2 Posted : Thursday, May 29, 2008 1:58:27 PM
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).
ChrisHynes
#3 Posted : Monday, June 02, 2008 7:50:40 PM
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
rreddy7
#4 Posted : Friday, June 20, 2008 12:05:56 PM
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

 

ChrisHynes
#5 Posted : Friday, June 20, 2008 12:55:40 PM
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.

rreddy7
#6 Posted : Friday, June 20, 2008 1:32:30 PM
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.

ChrisHynes
#7 Posted : Friday, June 20, 2008 1:45:12 PM
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
}
rreddy7
#8 Posted : Friday, June 20, 2008 1:58:04 PM
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?
ChrisHynes
#9 Posted : Saturday, June 21, 2008 12:34:05 PM
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.