Import picture in RTC

Lec11
Member Posts: 91
Hello,
I want to import several picture files at once in RTC from a specified folder. I created the following functions:
But when importing, the dialog window appears where I should choose the file.
I replace the BLOBImport line with the code from the function, using magicpath instead of folder and I receive the error
Am I missing something here?
Thanks!
I want to import several picture files at once in RTC from a specified folder. I created the following functions:
GetPictures(FilesPath : Text[100])
DirectoryInfo := DirectoryInfo.DirectoryInfo(FilesPath);
List := DirectoryInfo.GetFiles();
enumerator := List.GetEnumerator();
WHILE enumerator.MoveNext DO BEGIN
FileInfo := enumerator.Current();
IF FileInfo.Extension IN THEN
GetSinglePicture(FileInfo.FullName,FileInfo.Name,FileInfo.Extension);
END;
GetSinglePicture(FilePath : Text[100];FileName : Text[100];Extension : Text[10])
"3TierAutoMgmt".BLOBImport(TempBlob,FilePath,FALSE);
--rest of code where I'm parsing the file name--
But when importing, the dialog window appears where I should choose the file.
I replace the BLOBImport line with the code from the function, using magicpath instead of folder and I receive the error
File was not found.
Am I missing something here?
Thanks!
0
Answers
-
Noone? I'm not asking for the code, I only want a hint. Shouldn't BLOBImport function be enough to upload the file to the server?0
-
So nobody imports pictures in Nav. Ok, i'll manage it on my own.0
-
I have used below code successfully in NAV2013 to import files (which resides on the client) into a BLOB-field, without any dialogs:
ltxtServerFileName := lcduFileMgt.UploadFileSilent(ltxtClientFileName); ltmpAttachment.INIT; lcduFileMgt.BLOBImportFromServerFile(lrecBlobref,ltxtServerFileName); ltmpAttachment.Attachment := lrecBlobref.Blob; ltmpAttachment."File Extension" := COPYSTR(UPPERCASE(lcduFileMgt.GetExtension(ltxtClientFileName)),1,250); IF FILE.ERASE(ltxtServerFileName) THEN; Vars: lcduFileMgt : Codeunit 419 lrecBlobref : Record 99008535 ltmpAttachment : TEMPORARY Record 5062
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
I've managed to import the pictures without dialog by using the SilentUpload function from Nav 2009 and then importing the server file.
Thanks, Luc!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