source: other-projects/FileTransfer-WebSocketPair/testGXTWithGreenstone/src/com/gs3/testGXT/server/DownloadServlet.java@ 33053

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 
1package com.gs3.testGXT.server;
2
3import java.io.IOException;
4
5import javax.servlet.ServletException;
6import javax.servlet.ServletOutputStream;
7import javax.servlet.http.HttpServlet;
8import javax.servlet.http.HttpServletRequest;
9import javax.servlet.http.HttpServletResponse;
10
11@SuppressWarnings("serial")
12public 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.