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

Single button, automatic upload? Options
madad
#1 Posted : Thursday, February 04, 2010 6:09:19 PM
Rank: Newbie

Groups: Registered

Joined: 7/29/2009
Posts: 4
Location: Auckland

I'd like to create a page that automatically uploads the file immediately after it is selected - so the only button would be the "Add File" button.

Is this possible/difficult?

Cheers
Adam.

Axosoft
#2 Posted : Thursday, February 04, 2010 6:22:24 PM
Rank: Administration


Groups: Administrators

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

Sure -- it's fairly straightforward:

 - Add these attributes to the SlickUpload control: MaxFiles="1" OnClientFileAdded="onFileAdded". The MaxFiles setting will limit the files selected to 1, and the OnClientFileAdded setting registers the specified javascript function to be called as an event when a file is added.
 - Add the following javascript on your page (replacing SlickUpload1 with whatever you named your SlickUpload control):

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

This will trigger an upload when the file added event is fired.

madad
#3 Posted : Thursday, February 04, 2010 6:23:22 PM
Rank: Newbie

Groups: Registered

Joined: 7/29/2009
Posts: 4
Location: Auckland

Wow! What great service, thanks for the prompt response, I'll try this now.

madad
#4 Posted : Thursday, February 04, 2010 8:03:18 PM
Rank: Newbie

Groups: Registered

Joined: 7/29/2009
Posts: 4
Location: Auckland

Thanks for the help, that works exactly as I wanted it to.

Cheers
Adam.

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.