|
|
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
|
|
|
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"
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/12/2010 Posts: 7
|
Many thanks works perfectly!
Regards
|
|
|
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
|
|
|
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(); }
|
|
|
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.
|
|
|
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
|
|
|
|
Guest |