| 63 |
|
|
| 64 |
private static final String UPLOAD_MAX_FILE_SIZE = "uploadMaxFileSize"; |
private static final String UPLOAD_MAX_FILE_SIZE = "uploadMaxFileSize"; |
| 65 |
|
|
| 66 |
|
private static final String MULTIPART_ENCODING = "multipartEncoding"; |
| 67 |
|
|
| 68 |
private int uploadMaxFileSize = 100 * 1024 * 1024; // 10 MB |
private int uploadMaxFileSize = 100 * 1024 * 1024; // 10 MB |
| 69 |
|
|
| 70 |
private int uploadThresholdSize = 1 * 1024 * 1024; // 1 MB |
private int uploadThresholdSize = 1 * 1024 * 1024; // 1 MB |
| 71 |
|
|
| 72 |
private String uploadRepositoryPath = null; // standard temp directory |
private String uploadRepositoryPath = null; // standard temp directory |
| 73 |
|
|
| 74 |
|
private String multipartEncoding = null; |
| 75 |
|
|
| 76 |
private PortletConfig portletConfig; |
private PortletConfig portletConfig; |
| 77 |
|
|
| 78 |
/** |
/** |
| 100 |
uploadRepositoryPath = filterConfig |
uploadRepositoryPath = filterConfig |
| 101 |
.getInitParameter(UPLOAD_REPOSITORY_PATH); |
.getInitParameter(UPLOAD_REPOSITORY_PATH); |
| 102 |
|
|
| 103 |
|
multipartEncoding = filterConfig.getInitParameter(MULTIPART_ENCODING); |
| 104 |
|
|
| 105 |
if (log.isDebugEnabled()) { |
if (log.isDebugEnabled()) { |
| 106 |
log.debug("uploadMaxFileSize=" + uploadMaxFileSize); |
log.debug("uploadMaxFileSize=" + uploadMaxFileSize); |
| 107 |
log.debug("uploadThresholdSize=" + uploadThresholdSize); |
log.debug("uploadThresholdSize=" + uploadThresholdSize); |
| 108 |
log.debug("uploadRepositoryPath=" + uploadRepositoryPath); |
log.debug("uploadRepositoryPath=" + uploadRepositoryPath); |
| 109 |
|
log.debug("multipartEncoding=" + multipartEncoding); |
| 110 |
// log.debug("mimeType=" + mimeType); |
// log.debug("mimeType=" + mimeType); |
| 111 |
} |
} |
| 112 |
} |
} |
| 256 |
if (PortletFileUpload.isMultipartContent(request)) { |
if (PortletFileUpload.isMultipartContent(request)) { |
| 257 |
if (log.isDebugEnabled()) |
if (log.isDebugEnabled()) |
| 258 |
log.debug("ActionRequest is multipart content."); |
log.debug("ActionRequest is multipart content."); |
| 259 |
|
if (multipartEncoding != null) { |
| 260 |
|
if (log.isDebugEnabled()) |
| 261 |
|
log.debug("Mutlipart encoding is " + multipartEncoding); |
| 262 |
|
request.setCharacterEncoding(multipartEncoding); |
| 263 |
|
} |
| 264 |
request = new MultipartPortletRequestWrapper(request, |
request = new MultipartPortletRequestWrapper(request, |
| 265 |
uploadMaxFileSize, uploadThresholdSize, |
uploadMaxFileSize, uploadThresholdSize, |
| 266 |
uploadRepositoryPath); |
uploadRepositoryPath); |