DownloadLink for an external URL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

DownloadLink for an external URL

gumnaam-2
I see that DownloadLink can be used to stream a File.

What I want to do is use DownLoadLink to redirect to  an external URL
that should be streamed (i.e. File Save box should pop up).

I can't use ExternalLink as the external URL's location is not pre determined,
also the external URL's location lookup is a costly so I don't want to do it unless
the User clicks on a link.

So in my case I do some thing like

class DownloadUrlLink {

 onClick() {

  URL externalUrl = getExternalURL(); //this is a costly operation, so I don't want to do it unless user clicks the Download link.
 getRequestCycle().setRequestTarget(new RedirectRequestTarget(url.toString()));
 
}

}

The URL points to a rather large gzipped XML file about 11MB in size.
But instead of popping up a File Save dialog, the browser starts to display the XML file.
and CPU usage jumps up to 100%, on account of the file being this large.

Is there a way to force the browser to pop up a FileSave dialog when using
RedirectRequestTarget

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket user list. Send a message to: "users-subscribe at wicket.apache.org" and follow the instructions.
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user
Reply | Threaded
Open this post in threaded view
|

Re: DownloadLink for an external URL

Igor Vaynberg-2
whatever streams that external file has to set a
content-disposition:attachment header so the browser pops up that box.

-igor


On 8/2/07, [hidden email] <[hidden email]> wrote:

>
> I see that DownloadLink can be used to stream a File.
>
> What I want to do is use DownLoadLink to redirect to  an external URL
> that should be streamed (i.e. File Save box should pop up).
>
> I can't use ExternalLink as the external URL's location is not pre
> determined,
> also the external URL's location lookup is a costly so I don't want to do
> it unless
> the User clicks on a link.
>
> So in my case I do some thing like
>
> class DownloadUrlLink {
>
> onClick() {
>
>   URL externalUrl = getExternalURL(); //this is a costly operation, so I
> don't want to do it unless user clicks the Download link.
> getRequestCycle().setRequestTarget(new RedirectRequestTarget(url.toString
> ()));
>
> }
>
> }
>
> The URL points to a rather large gzipped XML file about 11MB in size.
> But instead of popping up a File Save dialog, the browser starts to
> display the XML file.
> and CPU usage jumps up to 100%, on account of the file being this large.
>
> Is there a way to force the browser to pop up a FileSave dialog when using
> RedirectRequestTarget
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> IMPORTANT NOTICE:
>
> This mailing list is shutting down. Please subscribe to the Apache Wicket
> user list. Send a message to: "users-subscribe at wicket.apache.org" and
> follow the instructions.
> _______________________________________________
> Wicket-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket user list. Send a message to: "users-subscribe at wicket.apache.org" and follow the instructions.
_______________________________________________
Wicket-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wicket-user