Welcome Guest Search | Active Topics | Sign In | Register

File Explorer: Server-side download argument Options
kronns
Posted: Thursday, January 29, 2009 3:30:27 AM
Rank: Newbie
Groups: Member

Joined: 9/18/2008
Posts: 9
Hello. My problema is rather simple. I want to download a list of files I see in a file browser control. I don’t want to start the download from the client side through links, scripts or the like. I need to start the download process on the server side. Because of this, it is required some kind of event that includes a “SelectedFile” argument in order to download the selected files on the server. Could you provide a clear example of how to gain access to a server-side “selectedfile” argument?



Thanks
eo_support
Posted: Thursday, January 29, 2009 9:30:52 AM
Rank: Administration
Groups: Administration

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

The FileExplorer control is primarily a client side controls to browse server files. So you will always get the file path with JavaScript on the client side first by calling this function:

http://doc.essentialobjects.com/ViewDoc.aspx?book=1&t=JSDoc.Public.FileExplorer.getCurrentFile.html

Once you have the path in your JavaScript, you would need to trigger some kind of server calls from your JavaScript to transfer the file name as well as the control to the server side. You can then proceed to download in your server side code.

There are various ways to trigger server calls from JavaScript:
1. Redirect the browser to another Url (For example, by calling call window.open). This instructs the browser to get the page from your server and your server code will be called;
2. Postback the current page (usually by calling __doPostBack or form.submit). This posts back the current page and again your server side code will be called;
3. Raises an AJAX callback. You can do this with ASP.NET AJAX or our CallbackPanel. Please refer to the corresponding documentation for more details;

Since you will always start from JavaScript, so you will need to be familiar with JavaScript in order to do this.

Hope this helps.

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.