Hello Community,
I’m working on a Business Central (on-premises/SaaS) implementation where I need to integrate with Azure Blob Storage for document management. The goal is to allow users to:
- Upload files (e.g., PDFs, images, etc.) to Azure Blob Storage from Business Central.
- Preview files directly in a web browser by clicking a button (without downloading the file).
- Download files if needed.
Here’s my current setup and progress:
- I’ve already set up Azure Blob Storage integration in Business Central and can successfully upload and download files using AL code.
- The files are stored in a private container in Azure Blob Storage.
- I am able to generate a Shared Access Signature (SAS) URL programmatically for secure access to files.
Challenge:
While I can generate the SAS URL, I need guidance on how to open the file in a browser for web view directly from Business Central. For example:
- When a user clicks "View Document," the file (e.g., PDF) should open in a new browser tab instead of being downloaded locally.
- The web view should work for commonly supported file types (e.g., PDF, PNG, JPEG).
Key Questions:
- What is the best approach to implement the "View Document" functionality in AL? Specifically:
- How do I dynamically generate and open a SAS URL in the browser using the
HYPERLINK function?
- Are there better alternatives to
HYPERLINK for opening files in a new browser tab?
- How can I ensure the browser renders files like PDFs and images correctly?
- Should I set the
Content-Type during the file upload process to Azure Blob Storage?
- Are there any code examples or best practices for this use case?
Additional Information:
- Business Central version: <Provide Version, e.g., 22.x SaaS>
- Azure Blob Storage setup: Private container with SAS token-based access.
I appreciate any guidance, code examples, or alternative approaches you can provide. Thank you in advance for your help!
# Azure Blob Storage
#Business Central AL
#File Management
#Web Browser Integration
#Document Preview