|
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
|
|
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.aspxNote 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!
|
|
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
|
|
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!
|
|