Skip to content

Commit

Permalink
LPS-33448
Browse files Browse the repository at this point in the history
  • Loading branch information
daledotshan authored and brianchandotcom committed Mar 28, 2013
1 parent 159ce08 commit 47fd0a9
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,28 @@ public void uploadFieldFile(
inputStream = uploadRequest.getFileAsStream(
fieldNameValue, true);

if (Validator.isNull(fileName) && (inputStream == null)) {
Field field = fields.get(fieldName);

if (field != null) {
Locale locale = PortalUtil.getLocale(request);

Serializable fieldValue = field.getValue(locale);

JSONObject fileJSONObject =
JSONFactoryUtil.createJSONObject(
String.valueOf(fieldValue));

fileName = fileJSONObject.getString("name");

String filePath = fileJSONObject.getString("path");

inputStream = DLStoreUtil.getFileAsStream(
serviceContext.getCompanyId(),
CompanyConstants.SYSTEM, filePath);
}
}

if (inputStream != null) {
String filePath = storeFieldFile(
baseModel, fieldName, inputStream, serviceContext);
Expand Down

0 comments on commit 47fd0a9

Please sign in to comment.