Skip to content

Commit ec9ecfa

Browse files
authored
Insert an image from an Upload control in SD creates the GXI field wi… (#436)
* Insert an image from an Upload control in SD creates the GXI field with temp extension Issue: 91160 * Insert an image from an Upload control in SD creates the GXI field with temp extension Issue: 91160
1 parent 9863400 commit ec9ecfa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

java/src/main/java/com/genexus/db/driver/GXPreparedStatement.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import com.genexus.*;
3737
import com.genexus.common.classes.IGXPreparedStatement;
38+
import com.genexus.common.interfaces.SpecificImplementation;
3839
import com.genexus.internet.HttpContext;
3940
import com.genexus.util.GXFile;
4041
import com.genexus.util.GXServices;
@@ -954,6 +955,7 @@ public void setGXDbFileURI(int index, String fileName, String blobPath, int leng
954955

955956
fileName = fileName.trim();
956957
blobPath = blobPath.trim();
958+
String uploadNameValue = SpecificImplementation.GXutil.getUploadNameValue(blobPath);
957959

958960
//EMPTY BLOB
959961
if (blobPath == null || blobPath.trim().length() == 0) {
@@ -971,7 +973,7 @@ else if (blobPath.trim().length() > 0)
971973
{
972974
blobPath = com.genexus.GXutil.cutUploadPrefix(blobPath);
973975
File file = new File(blobPath);
974-
fileUri = GXDbFile.generateUri(file.getName(), !GXDbFile.hasToken(blobPath), true);
976+
fileUri = GXDbFile.generateUri(uploadNameValue.isEmpty()?file.getName(): uploadNameValue, !GXDbFile.hasToken(blobPath), true);
975977
}
976978

977979
boolean externalStorageEnabled = storageProvider != null;
@@ -1016,7 +1018,7 @@ else if (blobPath.trim().length() > 0)
10161018
GXFile gxFile = new GXFile(storageTargetObjectName, ResourceAccessControlList.Private); //Every temporal file is saved as private.
10171019
if (gxFile.exists()) {
10181020
// - 1. WebUpload: The URL is an External Storage URL in the Private Temp Storage Folder.
1019-
fileName = gxFile.getName();
1021+
fileName = uploadNameValue.isEmpty()? gxFile.getName(): uploadNameValue;
10201022
int idx = fileName.lastIndexOf("/");
10211023
if ((idx != -1) && (idx < fileName.length() - 1)) {
10221024
fileName = fileName.substring(idx + 1);

0 commit comments

Comments
 (0)