Zip-Import can overwrite .zip file / name collision

Description

Es gibt Probleme wenn man z.B. 94321779432177xl.jpeg.zip hoch laedt und das Bild 94321779432177xl.jpeg entpackt. Dies wird auch wenn es nicht existiert als overwrite erkannt und es wird dann auch das zip mit dem Bild ueberschrieben. Somit hat man ein Bild mit dem Namen "94321779432177xl.jpeg.zip" rumliegen, das weder als zip noch als Bild richtig funktioniert.

-> ev. check auf startsWith anstatt equals?

CAUTION parts of this work is already accidentally merged into dev-branch. Be aware before releasing 2.73.

Activity

Show:

Fabian Pichler 14 January 2016 at 19:47
Edited

I suggest to add a getAttachment(XWikiDocument doc, String filename) api method to IModelAccessFacade which wrappes and fixes the doc.getAttachment method. After that please use the IModelAccessFacade in ImageService to access the Attachments. Maybe we should throw a AttachmentNotExistsException if no document is found instead of returning null (relating to getDocument in IModelAccessFacade). I suggest that we could even add a second getSimilarAttachment api call to IModelAccessFacade which behaves like the doc.getAttachment method except the exception instead of returning null.

please check my comment on https://github.com/celements/celements-core/pull/31 and https://github.com/celements/celements-photo/pull/13/files

Fixed

Details

Priority

Assignee

Reporter

Components

Fix versions

Clockify

Created 15 June 2015 at 16:42
Updated 23 November 2016 at 17:36
Resolved 5 March 2016 at 11:59