Skip to content

Commit

Permalink
Set the correct name of the thumbnail when thumbnail is uploaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Eichar committed May 19, 2015
1 parent 3d56b3e commit c969fa9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/main/java/org/fao/geonet/services/thumbnail/Set.java
Expand Up @@ -125,7 +125,7 @@ public Response serviceSpecificExec(HttpServletRequest request,

if (createSmall)
{
Path smallFile = getFileName(file.getName(), true);
Path smallFile = getFileName(file.getOriginalFilename(), true);
Path outFile = metadataPublicDatadir.resolve(smallFile);

removeOldThumbnail(context, id, "small", false);
Expand All @@ -140,7 +140,7 @@ public Response serviceSpecificExec(HttpServletRequest request,

if (scaling)
{
Path newFile = getFileName(file.getName(), type.equals("small"));
Path newFile = getFileName(file.getOriginalFilename(), type.equals("small"));
Path outFile = metadataPublicDatadir.resolve(newFile);

createThumbnail(file, outFile, scalingFactor, scalingDir);
Expand All @@ -150,9 +150,9 @@ public Response serviceSpecificExec(HttpServletRequest request,
else
{
//--- move uploaded file to destination directory
Files.copy(file.getInputStream(), metadataPublicDatadir.resolve(file.getName()), StandardCopyOption.REPLACE_EXISTING);
Files.copy(file.getInputStream(), metadataPublicDatadir.resolve(file.getOriginalFilename()), StandardCopyOption.REPLACE_EXISTING);

dataMan.setThumbnail(context, id, type.equals("small"), file.getName(), false);
dataMan.setThumbnail(context, id, type.equals("small"), file.getOriginalFilename(), false);
}

dataMan.indexMetadata(id, true);
Expand Down

0 comments on commit c969fa9

Please sign in to comment.