DEXTUploadJ
DEXTUploadJ References > FileDownload > Method > DownloadStream
DownloadStream Method
- Version
- 1.0.1.0
- Environment
- Sun JDK1.4
- Target
- Download
- Signature
- public void DownloadStream(java.io.InputStream input, int FileSize, java.lang.String TargetFileName, boolean bAttach)
- Parameters
-
Name Signature Description input java.io.InputStream Assign InputStream type file source being downloaded. FileSize int Assign the size of file being downloaded. TargetFileName java.lang.String Assign the name of file being downloaded. bAttach boolean Selects whether to force save downloaded file.
- true: Web browser outputs save dialogue box since download data is always saved as file.
- false: Web browser processes differ according to MIME type. For example, web browser directly outputs download details if text/html (HTML file), outputs save dialogue box if application/x-zip-compressed (ZIP file).
- Return value
- Throws
- java.io.IOException
- Description
-
Download stream typed data such as Database to client user through web browser.
- Usage
-
if (rs.next()) { Blob blob = rs.getBlob("File"); String FileName = rs.getString("FileName"); FileDownload down = new FileDownload(request, response); InputStream input = blob.getBinaryStream(); down.DownloadStream(input, (int)blob.length(), FileName, true); input.close(); rs.close(); }