diff --git a/applications/content/src/org/ofbiz/content/ContentManagementServices.java b/applications/content/src/org/ofbiz/content/ContentManagementServices.java
index 8e4e2b3d7b..04c68457df 100644
--- a/applications/content/src/org/ofbiz/content/ContentManagementServices.java
+++ b/applications/content/src/org/ofbiz/content/ContentManagementServices.java
@@ -610,8 +610,10 @@ Debug.logInfo("updateSiteRoles, serviceContext(2):" + serviceContext, module);
String mimeTypeId = (String) newDrContext.get("mimeTypeId");
if (byteWrapper != null && (mimeTypeId == null || (mimeTypeId.indexOf("image") >= 0) || (mimeTypeId.indexOf("application") >= 0))) {
mimeTypeId = (String) context.get("_imageData_contentType");
- String fileName = (String) context.get("_imageData_fileName");
- newDrContext.put("objectInfo", fileName);
+ if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
+ String fileName = (String) context.get("_imageData_fileName");
+ newDrContext.put("objectInfo", fileName);
+ }
newDrContext.put("mimeTypeId", mimeTypeId);
}
@@ -697,7 +699,7 @@ Debug.logInfo("updateSiteRoles, serviceContext(2):" + serviceContext, module);
}
if (hasData || "true".equalsIgnoreCase(forceElectronicText)) {
fileContext.put("rootDir", context.get("rootDir"));
- fileContext.put("dataResourcetype", dataResourceTypeId);
+ fileContext.put("dataResourceTypeId", dataResourceTypeId);
fileContext.put("objectInfo", dataResource.get("objectInfo"));
thisResult = dispatcher.runSync("updateFile", fileContext);
errorMsg = ServiceUtil.getErrorMessage(thisResult);
diff --git a/applications/content/src/org/ofbiz/content/data/DataServices.java b/applications/content/src/org/ofbiz/content/data/DataServices.java
index de623e9932..00ffdc12aa 100644
--- a/applications/content/src/org/ofbiz/content/data/DataServices.java
+++ b/applications/content/src/org/ofbiz/content/data/DataServices.java
@@ -388,7 +388,7 @@ public class DataServices {
String fileName = "";
String sep = "";
try {
- if (UtilValidate.isEmpty(dataResourceTypeId) || dataResourceTypeId.equals("LOCAL_FILE")) {
+ if (UtilValidate.isEmpty(dataResourceTypeId) || dataResourceTypeId.startsWith("LOCAL_FILE")) {
fileName = prefix + sep + objectInfo;
file = new File(fileName);
if (file == null) {
@@ -397,13 +397,13 @@ public class DataServices {
if (!file.isAbsolute()) {
throw new GenericServiceException("File: " + fileName + " is not absolute.");
}
- } else if (dataResourceTypeId.equals("OFBIZ_FILE")) {
+ } else if (dataResourceTypeId.startsWith("OFBIZ_FILE")) {
prefix = System.getProperty("ofbiz.home");
if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {
sep = "/";
}
file = new File(prefix + sep + objectInfo);
- } else if (dataResourceTypeId.equals("CONTEXT_FILE")) {
+ } else if (dataResourceTypeId.startsWith("CONTEXT_FILE")) {
prefix = (String) context.get("rootDir");
if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {
sep = "/";
diff --git a/applications/content/widget/content/DataResourceForms.xml b/applications/content/widget/content/DataResourceForms.xml
index 9d03c39e22..0a0e0ab0ea 100644
--- a/applications/content/widget/content/DataResourceForms.xml
+++ b/applications/content/widget/content/DataResourceForms.xml
@@ -155,6 +155,9 @@ under the License.