Welcome Guest Search | Active Topics | Sign In | Register

How to start Ajax uploader from context menu Options
Hub
Posted: Monday, December 9, 2013 6:09:01 PM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hello,

I have used the Ajax uploader from a toolbar, but cannot find a way to trigger an upload from other controls.
Is it possible to start an upload from a context menu? If yes, how can I do it?

Thanks for your help

Hubert
eo_support
Posted: Monday, December 9, 2013 10:13:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

It is possible to trigger upload through JavaScript by calling the following method:

http://www.essentialobjects.com/doc/1/jsdoc.public.ajaxuploader.upload.aspx

Note that for this method to work the user would have to have already selected one or more files.

Or you can also set the uploader's AutoUpload to true, that way as soon as user selects a file, the upload automatically starts.

There is no way to automatically "grab" a file from user's computer and upload it to your server ----- this would be a serious security hole if a browser were to allow that. As such user must always explicitly select the file first.

Thanks!
Hub
Posted: Tuesday, December 10, 2013 7:59:32 AM
Rank: Advanced Member
Groups: Member

Joined: 3/16/2010
Posts: 101
Hi,

Thank you for your prompt answer. I did try the javascript upload method and thought it would open the file dialog for the user to pick a file for upload, but it did not (as you mention a file must be picked before). My question really is how to replicate with a context menu what happens with the toolbar button option: Open the file dialog and (with the autoupload option set to true) automatically start the upload.
I'm still not clear on how to do that.

Again thanks for your help.

Hubert
eo_support
Posted: Tuesday, December 10, 2013 8:41:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

There is no way to trigger the file dialog with script. For security reason, it must be an explicit user click on the file uploader control's browse button (or in case of a toolbar button in fact there is an invisible browse button there).

Thanks!


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.