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

Upload after select Options
jonpanky
#1 Posted : Tuesday, October 12, 2010 5:00:43 AM
Rank: Newbie

Groups: Registered

Joined: 10/12/2010
Posts: 7

I'm already using the SlickUpload.

A few of my members have asked if the upload could commence after they have selected the file rather than then having to click the upload button.

Is this possible?

Thanks in advance

Jon

Axosoft
#2 Posted : Tuesday, October 12, 2010 1:45:28 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

To do this, hook the onFileAdded event, and then start the upload when the file is selected.

So, add javascript like this (where "SlickUpload1" is the ID of the control on your page):

        function onFileAdded(data)
        {
            kw.get("<%=SlickUpload1.ClientID %>").submit();
        }

And then hook the event to up in the control by adding the following attribute to the SlickUpload control:

OnClientFileAdded="onFileAdded"

jonpanky
#3 Posted : Wednesday, October 13, 2010 3:12:35 AM
Rank: Newbie

Groups: Registered

Joined: 10/12/2010
Posts: 7

Many thanks works perfectly!

 

Regards

 

hotlazydaze
#4 Posted : Thursday, October 20, 2011 4:26:50 PM
Rank: Member

Groups: Registered

Joined: 10/3/2011
Posts: 13
Location: Spain
When I try this I get an error: Microsoft JScript runtime error: Object doesn't support property or method 'get'

Any idea why that might be happening?

Thanks
Axosoft
#5 Posted : Thursday, October 20, 2011 4:35:00 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

That's the old (SlickUpload 5) way to do it.

In SlickUpload 6, you should do:

function onFileAdded(data)
{
    kw("<%=SlickUpload1.ClientID %>").start();
}

hotlazydaze
#6 Posted : Thursday, October 20, 2011 4:44:42 PM
Rank: Member

Groups: Registered

Joined: 10/3/2011
Posts: 13
Location: Spain
Thanks, but now I'm getting: Microsoft JScript runtime error: Unable to get value of the property 'start': object is null or undefined

I have changed the code to:

function onFileAdded(data)
{
kw("<%=SlickUpload.ClientID %>").start();
}

...to match the ID of my upload control.
hotlazydaze
#7 Posted : Thursday, October 20, 2011 5:22:19 PM
Rank: Member

Groups: Registered

Joined: 10/3/2011
Posts: 13
Location: Spain
sorry, my mistake... I had a lowercase s in the ID name.

Thanks for your time Chris
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.