Welcome Guest Search | Active Topics | Sign In | Register

EO Web Downloader Trigger / Start server-side Options
TMcCabe
Posted: Tuesday, August 26, 2014 12:58:17 PM
Rank: Member
Groups: Member

Joined: 12/9/2010
Posts: 28
Is it possible to start the downloader server-side (e.g. without clicking a button or link at the UI)?

I'm working on a user control to handle requests for generating files raised from other user controls, so it is responding to custom events raised by other controls. My intent is for this to be a reusable handler for building and downloading files from different contexts.

I would like to have an EO.Web Downloader create the dynamic contents (similar to http://demo.essentialobjects.com/Demos/Downloader/Features/Dynamic%20Contents/Demo.aspx) and handle the download. However, I'm not seeing any way to trigger the download from the server-side.

Is there a server-side API for this (like the client-side 'start')?

I'd thought to call the event [downloader1_download(object, new eo.web.DownloadEventArgs());], but I'm getting an error that there is no constructor for the DownloadEventArgs.

I also tried raising the associated button's Click event, but that didn't result in the Download event getting called.
TMcCabe
Posted: Tuesday, August 26, 2014 2:55:20 PM
Rank: Member
Groups: Member

Joined: 12/9/2010
Posts: 28
As a side note, I've ended up giving up on attempting the reusable component this time due to time constraints, and am instead doing this a bit more directly so I can trigger the Downloader via a client-side Start call.

So, this isn't at all urgent, but is now rather a matter of curiosity.
eo_support
Posted: Wednesday, August 27, 2014 9:53:44 AM
Rank: Administration
Groups: Administration

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

You won't be able to trigger the download directly from server side. One of the main principle for browser design is that a new window can only be triggered by the user. This is the direct result of popup abuse during the early years. In all newer browsers, popup/new window opened by script are automatically blocked unless they are a direct result of user clicking a mouse. A file download is essentially a new window that pulls a file of non HTML format (or in HTML format but the server explicitly instructs the browser to treat it as a download instead of displaying it). Because of this, user action is almost always required immediately prior to the download (different browsers may have different exceptions on this but it's not something you want to get into or count on since they can change).

From the component point of view, you can handle an event but you can not force an event unless the component provides you a way to do it. Calling an event handler directly does not trigger the event, nor will it trigger any other actions associated with the event. So even if DownloadEventArgs had a public constructor calling your own event handler would not cause the download to start.

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.