Comments (1)
Since v6.4 we are using FileProvider API. There are many built-in file providers e.g. FileSystemFileProvider, UrlFileProvider, DataUrlFileProvider, StreamFileProvider, MemoryFileProvider, DatabaseFileProvider, AssemblyResourceFileProvider, TemporaryFileProvider.
For generating the cache key, to uniquely identify a document file, we use a string combination of file extension, file size and file date, this way cache collisions do not occur and we can resuse the cached file even if the file name before extension is changed (file1.docx and file2.docx have same cache key because it's still the same document according to file extension, file size and file date).
File providers like FileSystemFileProvider (a file on disk, on Amazon S3, on Azure) can provide file size and file date automatically however some file providers will not have this knowledge, e.g. StreamFileProvider, MemoryFileProvider (how could they know date modified of your data in a byte array or a stream?).
So for this purpose, these kind of providers have an additional property or constructor argument named DateModified and/or Size. You need to specify these to ensure you uniquely identify a document:
//Optional parameters (used for detailed file info, e.g. for generating better cache keys)
documentViewer.Document = new StreamFileProvider(
"SomeFolder/SomeFile.ext",
yourStream,
yourFileDateModified,
yourFileSize //Provide size only if your stream is not seekable
);
//Optional parameters (used for detailed file info, e.g. for generating better cache keys)
documentViewer.Document = new MemoryFileProvider(
"SomeFolder/SomeFile.ext",
yourMemoryStream,
yourFileDateModified
);
//Optional parameters (used for detailed file info, e.g. for generating better cache keys)
documentViewer.Document = new MemoryFileProvider(
"SomeFolder/SomeFile.ext",
yourByteArray,
yourFileDateModified
);
from documentultimate.
Related Issues (11)
- Excel files are not rendering correctly. HOT 1
- Merge PDF file
- Print event HOT 1
- Format of the initialization string does not conform to specification starting at index 0 HOT 5
- error asp.net core HOT 2
- .NET Core assembly error HOT 1
- DocumentUltimate not working with asp.net core 3 HOT 3
- Document Cache info is not found issue HOT 2
- DocumentUltimate- Powerpoint files not loading HOT 1
- GleamTech.DocumentUltimate document viewer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentultimate.