Not able to save/download file on local pc. File is available inside code in byte[]

Viewed 31

I am working on SharePoint web application backend c# and hosted on azure. Basically I working on virtual machine. Using citrix to access pc.

I have file data in format of byte[] array in side code and want to save/download it on local, but I am not able to do that.

For download I used response streams Example :- Response.output (data) / Response.Binarywrite(data).

This didn't work

Or

To save on local I used desktop path

string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)

Above code return some different location which is not accessible for me.

Error : D:/Windows/System32 not accessible.

Previously I used above code to access desktop it always work without any error. But looks like as I am working on virtual machine and application is also hosted on azure that's why it's returning some different path.

Please help me. How I can save/download file on my local?

Thanks in advance.

0 Answers
Related