Skip to content
Snippets Groups Projects
Commit cb1c5fc9 authored by Wolfgang Meier's avatar Wolfgang Meier
Browse files

[ignore] For downloading backups, make sure the Content-Length header is set...

[ignore] For downloading backups, make sure the Content-Length header is set to help the servlet engine.

svn path=/trunk/eXist/; revision=18721
parent f6ac3419
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,8 @@ public class RetrieveBackup extends BasicFunction
new FunctionParameterSequenceType( "name", Type.STRING, Cardinality.EXACTLY_ONE, "The name of the file to retrieve." )
}, new SequenceType( Type.ITEM, Cardinality.EMPTY ) );
private final static int CHUNK_SIZE = 512 * 1024;
public RetrieveBackup( XQueryContext context )
{
super( context, signature );
......@@ -111,7 +113,7 @@ public class RetrieveBackup extends BasicFunction
final ResponseWrapper response = (ResponseWrapper)respValue.getObject();
response.setContentType( "application/zip" );
response.setHeader("Content-Length", String.valueOf(backupFile.length()));
try {
final InputStream is = new FileInputStream( backupFile );
final OutputStream os = response.getOutputStream();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment