What's the difference between uploading an asset into the library or DMS?
You are not sure whether to use the Library or the Document Management System (DMS) to get a particular asset (like a PDF) to display in a window or prompt a download.
The Workarea is designed to download DMS assets, while library items are to be displayed in a browser.
- DMS uses logical folder paths, which do not appear in the file system.
- DMS checks the database to find a file location on the Web server and then send it to the client.
- DMS prompts a download and provides the following advantages:
- You can apply permissions to the content item, which cannot be done for individual files in the library.
- Added security obfuscates the item's file name so it cannot be accessed by anyone who knows the file path.
- You have access to the file's revision history.
Potential Workaround
If you still want a method to have PDF documents display in a browser rather than download, the following code may be able to help.
IMPORTANT: This is a customization that goes against the default behavior of the Ektron CMS. Make a backup copy of the file prior to any code changes.
Navigate to: Workarea\DownloadAsset.aspx comment out the line for Response.AddHeader .
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + (Request.Browser.Browser == "IE" ? (Server.UrlPathEncode(System.IO.Path.GetFileNameWithoutExtension(_assetData.Handle))) : (System.IO.Path.GetFileNameWithoutExtension(_assetData.Handle))) + ext + "\"");
and change it to this:
Response.AddHeader("Content-Disposition", (string) ((ext.Contains("pdf")) ? "inline" : "attachment") + "; filename=\"" + (Request.Browser.Browser == "IE" ? (Server.UrlPathEncode(System.IO.Path.GetFileNameWithoutExtension(_assetData.Handle))) : (System.IO.Path.GetFileNameWithoutExtension(_assetData.Handle))) + ext + "\"");
Please sign in to leave a comment.