diff --git a/UI/MailPartViewers/UIxMailPartImageViewer.m b/UI/MailPartViewers/UIxMailPartImageViewer.m
index bb05b1a2f..33bbfee45 100644
--- a/UI/MailPartViewers/UIxMailPartImageViewer.m
+++ b/UI/MailPartViewers/UIxMailPartImageViewer.m
@@ -1,14 +1,15 @@
/*
+ Copyright (C) 2007-2015 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
- This file is part of OpenGroupware.org.
+ This file is part of SOGo
- OGo is free software; you can redistribute it and/or modify it under
+ SOGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ SOGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
diff --git a/UI/MailPartViewers/UIxMailPartViewer.m b/UI/MailPartViewers/UIxMailPartViewer.m
index a34bcb2ab..eb481d6d5 100644
--- a/UI/MailPartViewers/UIxMailPartViewer.m
+++ b/UI/MailPartViewers/UIxMailPartViewer.m
@@ -303,7 +303,7 @@
return [filename stringByEscapingURL];
}
-- (NSString *) pathToAttachment
+- (NSString *) _pathForAttachmentOrDownload: (BOOL) forDownload
{
NSMutableString *url;
NSString *s, *attachment;
@@ -315,16 +315,29 @@
if (![url hasSuffix: @"/"])
[url appendString: @"/"];
-// s = [[self partPath] componentsJoinedByString: @"/"];
if ([bodyPart isKindOfClass: [SOGoMailBodyPart class]])
attachment = [self _filenameForAttachment: bodyPart];
else
attachment = @"0";
+
+ if (forDownload)
+ [url appendString: @"asAttachment/"];
+
[url appendString: attachment];
return url;
}
+- (NSString *) pathToAttachment
+{
+ return [self _pathForAttachmentOrDownload: NO];
+}
+
+- (NSString *) pathForDownload
+{
+ return [self _pathForAttachmentOrDownload: YES];
+}
+
- (NSString *) mimeImageURL
{
NSString *mimeImageFile, *mimeImageUrl;
diff --git a/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox b/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox
index 57da0493f..c9691ea59 100644
--- a/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox
+++ b/UI/Templates/MailPartViewers/UIxMailPartImageViewer.wox
@@ -1,9 +1,23 @@
-
+
+
+
+