This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes How to stream the bytes of the file from the action? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to stream the bytes of the file from the action?" Watch "How to stream the bytes of the file from the action?" New topic
Author

How to stream the bytes of the file from the action?

kavin clain
Ranch Hand

Joined: Jan 19, 2010
Posts: 68
How to stream the bytes of the file from the action?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

For S1:

Open a response output stream.
Write the file bytes to it.
Close the stream & flush.
Return null from action.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
For Struts 2, use Stream result!


OCJP 6 (93%)
 
jQuery in Action, 2nd edition
 
subject: How to stream the bytes of the file from the action?
 
Similar Threads
Storing images in a file
Gets the output of the ObjectOutputStream in a program
How to parse UTF-8 file with BOM
Saving InputStream to File
Show images dynamically from DB