We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

OriginalFileName property


Is there a way to preserve the OriginalFileName property when a document is loaded with the code below ?

FileStream stream = File.OpenRead(templateName);

Document document = new Document(stream);

document.OriginalFileName is always null !

Best regards,


Thanks for your inquiry. We have logged this feature request as WORDSNET-17673 in our issue tracking system. You will be notified via this forum thread once it is available. We apologize for your inconvenience.

As a workaround, you can use FileStream.Name property as shown below to get the file name. Hope this helps you.

FileStream stream = File.OpenRead(MyDir + "in.docx");
if (stream != null)