We recently upgraded from 4.4.1 to 6.0.1. It seems that the Save() function (specifically Save(string, SaveFormat) now requires an extension. If we attempt to save a file to a filename without an extension we get an ArgumentException with a text of “extension”. I reviewed the higlights for the releases we skipped and didn’t see any mention of this is the breaking changes.
Part of our original code was (where doc is a Document object):
string NewDocName = Guid.NewGuid().ToString();
string fullDocName = AttachmentDir + NewDocName;
doc.Save(fullDocName, SaveFormat.Rtf);
And we now must do this:
string NewDocName = Guid.NewGuid().ToString();
string fullDocName = AttachmentDir + NewDocName + ".rtf";
doc.Save(fullDocName, SaveFormat.Rtf);
System.IO.FileInfo fi = new System.IO.FileInfo(fullDocName);
fi.MoveTo(AttachmentDir + NewDocName);
Since the rest of our system is build around the fact that this file will not have extension when it’s saved, we’re forced to save it with the .RTF extension and then do a rename on the file to remove the .RTF extension.
Can we please have the requirement for an extension removed?