I am fetching a file stream from temp blob storage and I wanted to store it in a local path through code. I have tried the below code, but it is prompting a saveAs dialog whether to save the file to download folder, but I want the file stream to be saved to a specific path automatically through code itself. Please suggest a solution for this issue.
public static void main(Args _args)
FilePath tempDir = "C:\\Temp\\DIXF\\file.txt";
FileUploadTemporaryStorageResult result = File::GetFileFromUser() as FileUploadTemporaryStorageResult;
if (result && result.getUploadStatus())
fileUrl = result.getDownloadUrl();
readCon = Binary::constructFromMemoryStream(result.openResult()).getContainer();
System.IO.StreamReader sReader = new System.IO.StreamReader(result.openResult());
// Set file contentn string
str fileContent = sReader.ReadToEnd();
// Save file
Thanks in Advance,
File upload to blob storage is successful and download it with a save As dialog is happening but I want to directly save that blob storage file into local file path without prompting for our selection to store. Can Anyone suggest a solution to achieve this through code.
It's not possible - web applications can't somehow get access to the machine making HTTP requests to the web server and change files there. It's would be a security nightmare.
Either let users download files as usual, or you can use a local application downloading data from F&O (such as Recurring Integrations Scheduler) or save the data to a common location. For instance, you could save the file to Azure File Storage and map the storage as a local drive. It would look like what you wanted to achieve, but unlike your original design, this is possible.