I am trying to call DownloadFile to download the file, but it returns 401

Check the this.FileName string. I think this should be forward slashes / instead of back slashes \
Edit: backslashes are correct
Try to use relative path in the folder. like “OrderHed\Test.xls”
thanks for your reply!I tried backslashes, but the result was the same。
Thanks for your reply, I tried to use the absolute path, but the same problem still occurred
says your not authorised to that folder
Maybe more likely, the user is authorized but the process at the server is not.
thanks for your reply!The problem is caused by the wrong path! I use the Ice.Lib.PathHelper.GetFolderPath(Epicor.ServiceModel.Utilities.SpecialFolder.CompanyData)
Hi brother,
I’m facing the same problem, can you share how to use Ice.Lib.PathHelper.GetFolderPath to get a pass.
Thanks,
Thanh.
var baseFolderType = Epicor.ServiceModel.Utilities.SpecialFolder.UserData;
var userDataPath = Ice.Lib.PathHelper.GetFolderPath(Epicor.ServiceModel.Utilities.SpecialFolder.UserData);
var absoluteFileName = System.IO.Path.Join(userDataPath, "subfoldername/anothername/file.ext");
throw new Exception(absoluteFileName);
Thank you so much