You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Oliver Pelz <ol...@googlemail.com> on 2011/04/27 10:44:14 UTC

Creating direct download links to files

Hey all,

For an external webservice which tries to access content of my webapp I need
to generate direct download links to text files without streaming them.

Links like :   http://mywebapp/Downloads/Textfile.txt

what is the best way to implement this in tapestry.

All the solutions I tried had to do with streaming those files but this does
not work as the webservice trying to access the files cannot handle file
streaming (I guess it uses some kind of wget in the background)

Is there a way to do this with assets ?

Thanks in advance for helping out

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Creating-direct-download-links-to-files-tp4343084p4343084.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Creating direct download links to files

Posted by olip <ol...@googlemail.com>.
thanks LLTYK again for your reply.

I was really stupid and feel a bit embarrased now.

I solved it but it had nothing to do with wget, that was fine.

Problem was for security reason I stored the URL of the inital calling
request from the external webservice in a sessionstate variable and checked 
for its existence when somebody tries to call the download page
http://host/webapp/STREAMPAGE/JOBID/RUNID/PASSWORD (download should only be
available for people using the external webservice)
in a webbrowser when testing it from starting from the external webservice
everything went fine but testing from wget will fail because it has no
access to the existing web SESSION  :-(

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Creating-direct-download-links-to-files-tp6308634p6333590.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Creating direct download links to files

Posted by LLTYK <LL...@mailinator.com>.
Huh, wget has a bug in it where it ignores the Content-Dispostion.
https://bugzilla.redhat.com/show_bug.cgi?id=239351

But that would only result in weird filenames being saved. You seem to be
not streaming it right. Or  maybe something inbetween is dropping the
parameters.

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Creating-direct-download-links-to-files-tp6308634p6331840.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Creating direct download links to files

Posted by olip <ol...@googlemail.com>.
Thanks for your response.

Actually I have the following problem:

I now have tapestry URLS with the following format:

http://host/webapp/STREAMPAGE/JOBID/RUNID/PASSWORD

when I am accessing this URL in the browser I get the file behind it
streamed back.

When I use wget to fetch it I get the html code of the STREAMPAGE.

This is exact the same result I get from the webserver trying to connect to
my webapp to download the files.

Is there a way to use wget to download the streaming content from this page?

Thanks in advance
Oliver 

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Creating-direct-download-links-to-files-tp6308634p6331468.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Creating direct download links to files

Posted by LLTYK <LL...@mailinator.com>.
There's no difference between streaming and what you want. You're probably
just missing a header or something. For example, 'Content-Disposition:
attachment; filename=Textfile.txt' or such.

--
View this message in context: http://tapestry-users.832.n2.nabble.com/Creating-direct-download-links-to-files-tp6308634p6308992.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org