Download a File to a specific folder - WebClient BC

martinhocosta88
Member Posts: 27
With the web client, The function DownloadFromStream doesnt allow to specify the client folder where to save the file. Every file is saved to the browser default transfer folder.
In my scenario I want to save a txt file to a pre configured folder.
TempFile.CREATETEMPFILE();
TempFile.WRITE('abc');
TempFile.CREATEINSTREAM(NewStream);
DOWNLOADFROMSTREAM(NewStream,'','MyFolderPath','',MyFileName);
Whats the correct approach to apply on WebClient?
In my scenario I want to save a txt file to a pre configured folder.
TempFile.CREATETEMPFILE();
TempFile.WRITE('abc');
TempFile.CREATEINSTREAM(NewStream);
DOWNLOADFROMSTREAM(NewStream,'','MyFolderPath','',MyFileName);
Whats the correct approach to apply on WebClient?
0
Answers
-
Have you tried using the DownloadToFile function in CU 419 ? DownloadToFile(ServerFileName, ClientFileName)?
Or if that doesn't work, how about just calling the DownloadHandler function (also in CU 419) directly?0 -
I've tried bothand I get the following error. It seems its not able to create the temp file.
0 -
Ignore this comment, I mistakenly overlooked you were using CREATETEMPFILE, and posted irrelevant advice, sorry.0
-
I have the following:
FileOutFile.CreateTempFile;
tempFilename := FileOutFile.Name;
(...)
FileOutFile.CreateInStream(NewStream);
FileMgt.DownloadToFile(TempFileName, FileNameExp); //instead of DownloadFromStream
FileOutFile.Close();
Getting the following error:
0 -
Cehck if Event Viewer could give you more details. I've seen before on previous versions where I/O error was related with the file being used by another process.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions