Learning Abstracts: Article topics include programs and services that create substantive change in individual learners innovative effective or promising practices in teaching and learning strategies to involve all college employees in supporting student learning, retention, and completion.
Advice on performing essential leadership tasks, solutions to common problems, descriptions of model programs, and applications of leadership theory.
All NWTC employees have access to subscription-only professional resources, including: The file c:\Temp\ServerFile.txt gets downloaded to C:\Temp\NewFile.txt, and then uploaded back to the server as C:\Temp\ League for Innovation in the Community College's Innovation Stream-more commonly known as iStream-is the League’s comprehensive, online resource bank in which faculty, staff, and administrators can find solutions for research and reference needs. So, put all this together and the end result is: UPLOADINTOSTREAM( ”, ‘’, ”,FileToUpload,IStream) Īnd finally, save the InStream to a file on the server: Then use UPLOADINTOSTREAM to upload the file from MagicPath to the NAV Server: Once you know the location of MagicPath, the next step is to copy the file you want to upload into that folder:įileSystemObject.CopyFile(FolderName + ‘\’ + FileToUpload,MagicPath + ‘\’ + FileToUpload) Then extract the folder name from MagicPath:įOR i := STRLEN(MagicPath) DOWNTO 1 DO BEGIN
But what I would suggest instead, is to download a temp test file first, then see where MagicPath downloads it to. One way could be to work that out somehow. Remember the MagicPath location above includes the Process ID of RTC. With UPLOADINTOSTREAM you need to know it in advance. But with DOWNLOADFROMSTREAM it creates MagicPath for you and tells you where it is. IF FileSystemObject.FileExists(DestinationFileName) THENįileSystemObject.DeleteFile(DestinationFileName, TRUE) įileSystemObject.CopyFile(MagicPath,DestinationFileName) įileSystemObject.DeleteFile(magicpath, TRUE)
So, if you wanted to continue the code above and place and name the file to something specific on the client’s machine, add these lines:ĭestinationFileName := ‘c:\Temp\newfile.txt’ ‘Microsoft Scripting Runtime’.FileSystemObject So, what if we wanted to rename it to a specific name? We have the FILE object in C/AL, but of course since C/AL runs on the NAV Server and not on RTC, this won’t work since the purpose of the above is exactly to copy the file to the client machine.
The number 4612 in the MagicPath comes from the Process ID of RTC. The location will be something like this:Ĭ:\Users\\AppData\Local\Temp\Microsoft Dynamics NAV\4612\_TEMP_ff7c5a286cfd463f9f7d92ae5b4757e2
Now we have the file on the RTC machine, and MagicPath tells us its location. The code example below will copy a specific file from the NAV Server to the RTC machine with no questions asked about folder or file name or anything else:įileToDownload := ‘c:\Temp\ServerFile.txt’ ĭOWNLOADFROMSTREAM(IStream, ”, ‘’, ”,MagicPath) MagicPath is initiated by setting the folder name to ‘’ like this:ĭOWNLOADFROMSTREAM(IStream,”, ‘’, ”,MagicPath) The trick is to use MagicPath, like in codeunit 419 “3-Tier Automation Mgt.”. This is how you can automatically download and upload files without any user interactions: A few times now, we had the question: How can we use these functions without it displaying the dialog box to select a file and folder name? The C/AL commands DOWNLOADFROMSTREAM and UPLOADINTOSTREAM have the purpose of sending files between RTC and the NAV Server. The C/AL commands DOWNLOADFROMSTREAM and UPLOADINTOSTREAM have the purpose of sending files between RTC and the NAV Server.