Project

General

Profile

« Previous | Next » 

Revision 8034

include filename in the package download, though we can;t really use the PID because of all the potential characters in it that are not valid for filesystems.

View differences:

src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java
1293 1293
        id.setValue(pid);
1294 1294
        InputStream is = MNodeService.getInstance(request).getPackage(session, id);
1295 1295
        
1296
        // TODO: handle special characters in pid and use that for the filename
1297
        String filename = id.getValue();
1298
        filename = "dataPackage." + System.currentTimeMillis(); 
1299
        filename = filename + ".zip";
1300
        response.setHeader("Content-Disposition", "inline; filename=" + filename);
1296 1301
        response.setContentType("application/zip");
1297 1302
        response.setStatus(200);
1298 1303
        OutputStream out = response.getOutputStream();

Also available in: Unified diff