web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to download file from Azure BLOB storage to the soft client?

(0) ShareShare
ReportReport
Posted on by 2,127

It's dynamics 365, I'm working on integration piece of enhancement I was able to successfully upload the file to the Azure cloud. Now I have to download the same file to the browser(IE, Mozila, Crome) with the browser default dialog with a option "Save, Open, Save as" option. The problem I face is that I don't have any clue how to implement this on my X++.

I was able to get the response as the byte[] binary file from the C# logic but I don't know how to stream down the response to the Dynamics 365 framework to trigger the browser dialog to show up?


Could you please guide me on this...

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: How to download file from Azure BLOB storage to the soft client?

    Hi Sakthiananth,

    Regarding Azure blobs i have created azure storage account and azure containers on Azure platform.I have created a document type in Organization administration->Document management->Document types, Created a new document say ABC,and selected Azure storage in location.

    Now my concern is how can we upload a document/file from AX D365 for a record and it sits in Azure storage.Is there any code to do, if yes then which code and where can write that? Kindly let me know step by step.

    Thanks in advance

    Apoorv

  • Suggested answer
    Sakthiananth Profile Picture
    2,127 on at
    RE: How to download file from Azure BLOB storage to the soft client?

    @Martin. Thanks for your help. it was my fault in specifying the file name on the method[FileUploadTemporaryStorageStrategy.UploadFile]. I should've specified name with the file extension. Now I had corrected it and it's working like charm. Thanks once again for your support buddy.

  • Martin Dráb Profile Picture
    235,814 Most Valuable Professional on at
    RE: How to download file from Azure BLOB storage to the soft client?

    What your picture shows looks like CSV to me (not some unknown format), so I wouldn't say it's not in CSV format anymore. If it's different form what you uploaded, please tell us what has changed.

    If you agree the format still is CSV and the data is the same, you must meant something else than the data format, such as the file name (file extension) or the MIME type.

  • Sakthiananth Profile Picture
    2,127 on at
    RE: How to download file from Azure BLOB storage to the soft client?

    Thanks for the quick reply Martin:). For your first query, No. For your suggestion: Yes, I'm trying to achieve this implementation using the specify folder where the desired files will be kept to upload to the could  and I'm half way through on this process of getting the output. I was able to upload the file to the Azure could storage successfully and now trying to download it. Here's the problem: When I download it, It's not the same as the format of the uploaded one. I'm uploading the file as ".csv" when I download it it's in unknown format any Idea here Martin?

    Here's the logic to upload the file with out user interaction:

    2017_2D00_01_2D00_13_5F00_15_2D00_24_2D00_24.png

    This's the output I was getting form the URL:

    2017_2D00_01_2D00_13_5F00_15_2D00_24_2D00_24.png

  • Martin Dráb Profile Picture
    235,814 Most Valuable Professional on at
    RE: How to download file from Azure BLOB storage to the soft client?

    Do you mean that you want a web application silently connecting to user's disk and stealing data from there? That's exactly what you don't want to happen when you browse the internet... No, this isn't feasible.

    But you could think about different solutions. For example, you can make a folder where users put their files and a periodic process will upload them to AX. And your transaction would somehow now which of the uploaded files to use.

  • Sakthiananth Profile Picture
    2,127 on at
    RE: How to download file from Azure BLOB storage to the soft client?

    Hi Martin, I believe I should use SharedServiceUnitStorage to store my file temporarily on the Azure cloud later the user can download back on to the client rather than using the Azure subscription driven storage. So I'm now following your way of uploading the file but is there any way with out user interaction we can upload the file by just specifying the location of the file from the local hard drive? Because I want to perform this action while performing the transaction and I wonder how the uploading time could be managed in amidst of transaction?

  • Verified answer
    Martin Dráb Profile Picture
    235,814 Most Valuable Professional on at
    RE: How to download file from Azure BLOB storage to the soft client?

    The solution is used by standard AX (e.g. when you download document arttachments), so it definitely works. Of course, the URL must be reachable by the user - this isn't going to bypass security. It seems that your URL isn't reachable, so copy the file somewhere where it can be downloaded and only then give it to the user.

    Look at File upload and download in AX 7 and try the code there - it'll prove to you that it works.

  • Sakthiananth Profile Picture
    2,127 on at
    RE: How to download file from Azure BLOB storage to the soft client?

    Hi Martin, Thanks for the quick reply. I have tried your suggestion and Interested to know that we can open the file through this way as well, but new browser() didn't work in my case since I'm using the Azure BLOB store I had to pass the credentials to access it and I think this could be the reason behind I was getting a error the http error 404. I believe I can't access the file link directly I guess? Could please throw some light on this one.

    This's the logic behind the scene I've implemented:

    2017_2D00_01_2D00_12_5F00_20_2D00_20_2D00_16.png

  • Martin Dráb Profile Picture
    235,814 Most Valuable Professional on at
    RE: How to download file from Azure BLOB storage to the soft client?

    Get the URL of the file and use it in new Browser().navigate(fileUrl).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
KP-31070522-0 Profile Picture

KP-31070522-0 3

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans