Author |
|
juris Groupie
Joined: 27 June 2011 Location: Italy
Online Status: Offline Posts: 72
|
Posted: 17 February 2015 at 9:12am | IP Logged
|
|
|
Hello support,
How I save attachments and preserve timestamps?
foreach (Attachment attach in msg.Attachments)
{
// This changes the timestamps!!
attach.Save(@"C:\Temp\" + attach.Filename, true);
}
================[ I want result like this...] ================================
static void CopyFileExactly(string copyFromPath, string copyToPath)
{
var origin = new FileInfo(copyFromPath);
origin.CopyTo(copyToPath, true);
var destination = new FileInfo(copyToPath);
destination.CreationTime = origin.CreationTime;
destination.LastWriteTime = origin.LastWriteTime;
destination.LastAccessTime = origin.LastAccessTime;
}
===================================================================
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 17 February 2015 at 10:23am | IP Logged
|
|
|
I don't understand this. Timestamp makes sense for a file, not for attachment. Attachment is just a MIME part in a mail message. It does not have any timestamp associated with it. When you save an attachment into a file, the file gets timestamp of the moment of saving because there is no other timestamp which could have been used for that.
Regards,
Alex
|
Back to Top |
|
|
juris Groupie
Joined: 27 June 2011 Location: Italy
Online Status: Offline Posts: 72
|
Posted: 17 February 2015 at 1:29pm | IP Logged
|
|
|
Hello Alex,
Thanks for the reply
Lello
|
Back to Top |
|
|