Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader: Open the select file dialog from javascript Options
HT
Posted: Saturday, December 20, 2008 8:39:47 AM
Rank: Advanced Member
Groups: Member

Joined: 3/18/2008
Posts: 41
Hi.

AjaxUploader: Is there a way to open the file dialog using javascript? I have tried to simulate a click on the "Browse" button, but it does not open the file dialog.

Code: JavaScript
document.getElementById('ctl00_ContentPlaceHolder1_AJAXUploaderPicture_BrowseButton0').click();


Is there another way to open the file dialog from javascript?

HT
eo_support
Posted: Saturday, December 20, 2008 9:23:25 AM
Rank: Administration
Groups: Administration

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

I am not sure if that's possible. One of the security principle for file upload is that user must initiate the upload (by clicking the browse button to browse a file) so that user is well aware of that he/she is sending one of his own files to the server. Because of this, the file input element exposes very little functionalities through JavaScript. I know for sure that you can not "pick a file" for the user with JavaScript. I am not sure whether you can open the dialog with JavaScript.

Implementations that need to overcome these limitations are generally based on plug-in based technologies, such as Flash or ActiveX. Since our uploader is pure JavaScript and DHTML, so it currently only does what DHTML/JavaScript can do.

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.