Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Folder permission for downloading file through x++ code

Posted on by 240

I am using the methods below in my AIF service class to download a file on the server. 

new FileIOPermission(downloadsDir, "rw").assert();


webClient = new System.Net.WebClient();

webClient.DownloadFile(filePath, downloadedFile);

I have successfully able to download the file in a folder which is accessible to "everyone" and the owner name of downloaded file is showing as AOS service account user. 

So my question is that if I need to download the file in a folder with limited rights, I would only need to give permission to AOS user or all the users calling the service would also need permission for the folder.

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: Folder permission for downloading file through x++ code

    Hi Hassan,

    If you are planning only to run your code only on the server-side, it's enough to give access only to AOS user. Otherwise, each user who will run the operation should have access to the folder.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans