Last change
on this file since 33053 was 33053, checked in by ak19, 5 years ago |
I still had some stuff of Nathan Kelly's (FileTransfer-WebSocketPair) sitting on my USB. Had already commited the Themes folder at the time, 2 years back. Not sure if he wanted this additional folder commited. But I didn't want to delete it and decided it will be better off on SVN. When we use his project, if we find we didn't need this test folder, we can remove it from svn then.
|
File size:
1.0 KB
|
Line | |
---|
1 | package com.gs3.testGXT.server;
|
---|
2 |
|
---|
3 | import java.io.IOException;
|
---|
4 |
|
---|
5 | import javax.servlet.ServletException;
|
---|
6 | import javax.servlet.ServletOutputStream;
|
---|
7 | import javax.servlet.http.HttpServlet;
|
---|
8 | import javax.servlet.http.HttpServletRequest;
|
---|
9 | import javax.servlet.http.HttpServletResponse;
|
---|
10 |
|
---|
11 | @SuppressWarnings("serial")
|
---|
12 | public class DownloadServlet extends HttpServlet{
|
---|
13 | private final String base_file_directory = "";
|
---|
14 |
|
---|
15 | //downloads should happen in POST requests
|
---|
16 | protected void doPost( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException
|
---|
17 | {
|
---|
18 | //String fileName = req.getParameter( "fileInfo1" );
|
---|
19 |
|
---|
20 | int BUFFER = 1024 * 100;
|
---|
21 | //resp.setContentType( "application/octet-stream" );
|
---|
22 | //resp.setHeader( "Content-Disposition:", "attachment;filename=" + "\"" + fileName + "\"" );
|
---|
23 | //ServletOutputStream outputStream = resp.getOutputStream();
|
---|
24 | ///resp.setContentLength( Long.valueOf( getfile(fileName).length() ).intValue() );
|
---|
25 | //resp.setBufferSize( BUFFER );
|
---|
26 | //Your IO code goes here to create a file and set to outputStream//
|
---|
27 |
|
---|
28 | }
|
---|
29 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.