EldoS | Feel safer!

Software components for data protection, secure storage and transfer

AddAttachment to Simple MIME Message locks file.

Posted: 10/11/2012 06:18:09
by Niklas Kjellander (Standard support level)
Joined: 09/30/2008
Posts: 54

Edit: Note that the Message topic really is regarding AttachFile method of TElSimpleMIMEAttachment

When adding an attachment to the TElSimpleMIMEMessage (.Net) and calling the AttachFile method of the attachment, the attached file seems to be opened for booth reading and writing. This blocks others from opening the file for reading. Of course one could set FileShare to ReadWrite when opening it, but allowing others to write to a file whlie reading from it is not always ideal.

Question, is it nescessary for the message/attachment to open the file for booth reading and writing, wouldn't it be enough to open it for reading and allowing others to read from it as well?

Best regards,

Niklas Kjellander
Posted: 10/11/2012 06:22:52
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

Could you please clarify how do you add the file as an attachment? You can post your code here.
Posted: 10/11/2012 06:26:09
by Niklas Kjellander (Standard support level)
Joined: 09/30/2008
Posts: 54

See edits of the original post.
Posted: 10/11/2012 06:28:49
by Eugene Mayevski (Team)

You probably mean AttachFile method, don't you? Indeed the file is opened exclusively in .NET and Java edition. Ac a workround you can open the file yourself and set ContentStream property of TElFileAttachment to the newly opened stream. BTW in Windows RT this is the only method, as Windows RT doesn't offer functionality to access files.

Sincerely yours
Eugene Mayevski



Topic viewed 518 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!