[ http://issues.apache.org/jira/browse/TAPESTRY-305?page=all ]
Brian K. Wallace resolved TAPESTRY-305:
---------------------------------------
Fix Version: 4.0.3
Resolution: Fixed
This has already been addressed.
> Wrong example for file download
> -------------------------------
>
> Key: TAPESTRY-305
> URL: http://issues.apache.org/jira/browse/TAPESTRY-305
> Project: Tapestry
> Type: Bug
> Components: Documentation
> Versions: unspecified
> Reporter: Ivo Danihelka
> Priority: Minor
> Fix For: 4.0.3
>
> Method InputStream.read(buffer) returns number of bytes read into the buffer.
> Tapestry FAQ contains example "How do I stream a file to the user from
> tapestry?":
> byte[] data = new byte[1024];
> ...
> while (in.read(data) > -1)
> {
> out.write(data);
> }
> =============
> It should be something like:
> int len;
> while ((len = in.read(data)) > -1)
> {
> out.write(data, 0, len);
> }
> =============
> Or I'm wrong and response.setContentLength() will handle this?
> Tapestry FAQ:
> http://jakarta.apache.org/tapestry/faq.html#faq-N1012F
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]