Global Bug Report

This bug existed in Aspose Email and Words too which I’ve reported and is now fixed, seems that all or most other products are also affected, this ticket is for Aspose Imaging, but I’ve posted this report in Total so maybe other developers check the existanse of this bug and take time to fix this in their products…

When a file is being loaded into SDK for reading, why you check if it’s not READ-ONLY? We’re just reading it, imagine if file is on read-only media like CD/DVD or on a SD Card which is write-protected, and if developers don’t check such conditions, they will release an app with a critical nasty bug, which seems to be the case…

Using this sample:
How to clean exif data in tiff image|Documentation (

Using image As Aspose.Imaging.FileFormats.Tiff.TiffImage = CType(Aspose.Imaging.Image.Load("D:\IMG_1190.tif"), Aspose.Imaging.FileFormats.Tiff.TiffImage)

Will cause System.UnauthorizedAccessException with this error:
Access to the path ‘D:\IMG_1190.tif’ is denied.

For Email, I found it in different functions and reported each one in separate reports which all were fixed, but this caused me to think that due to lack of proper quality control standards or boredom of developers in charge, they won’t take 5 minutes to do a project wide search and check all functions that accept files as input and fix this issue, so I never pass file names as string to the Aspose, but read it myself and pass the Stream to Aspose, but please consider this check is all Aspose products, this is a nasty bug.

What surprises me is that this far after releasing Aspose SDKs and having so many developers using them, how these never reported before?

Anyway, thanks for your consideration. As I can see you have reported a similar issue upon creating CertificateHolder from read-only protected file. The issue is logged as WORDSNET-25903. I have tested with reading document from read-only protected file and there is no issues with Aspose.Words. Upon opening document from file File.OpenRead method is used.

1 Like

Hello and thanks, can’t quite recall but yes, using File.OpenRead method is a workaround I told myself (If I’m no wrong)

If you pass the file name directly to Aspose, the exception will be thrown, again if I’m not mistaken the bug was approved, no idea if fixed or not, but I suspected that other Aspose SDKs will surely suffer from this here and there, I’ve no idea what’s the underlying code for reading a file that throws this, but the devs that know, can do a project wide search and check if such scenario can occur elsewhere! :slight_smile:
By testing multiple file formats with the latest version, Aspose.Cells can load read-only files normally through the file path. If you have any questions, please feel free to contact us.

The issues you have found earlier (filed as WORDSNET-25903) have been fixed in this Aspose.Words for .NET 24.1 update also available on NuGet.