Upload multiple pictures from folder to BC16 webclient without dialog

dep_cornator
Member Posts: 3
Hi,
I want to upload multiple pictures from a folder to the BC16 webclient (OnPrem) without a dialog. Therefore I can't use UPLOADINTOSTREAM function and using the file management codeunit is not allowed in an extension.
Is there a possible workaround (SQL query, PowerShell, Webservice)?
I want to upload multiple pictures from a folder to the BC16 webclient (OnPrem) without a dialog. Therefore I can't use UPLOADINTOSTREAM function and using the file management codeunit is not allowed in an extension.
Is there a possible workaround (SQL query, PowerShell, Webservice)?
0
Best Answer
-
Hello @dep_cornator ,
You can use something like that:DirectoryPath := 'C:\run'; fileMgt.GetServerDirectoryFilesListInclSubDirs(TempNameValueBuffer, DirectoryPath); if TempNameValueBuffer.FindSet() then repeat if fileMgt.GetFileName(TempNameValueBuffer.Name) = 'start.ps1' then begin fileMgt.BLOBImportFromServerFile(TempBlob, TempNameValueBuffer.Name); if TempBlob.HasValue() then begin TempBlob.CreateInStream(InStr); InStr.ReadText(qTexto); end; exit; end; until TempNameValueBuffer.Next() = 0;
But the paths and files must be in the server, you don't have access to the client file system, later on with the InStream you can do whatever you want.
Regards1
Answers
-
Hello @dep_cornator ,
If your app target is "OnPrem"
You can use the file management codeunit.
Regards.0 -
How @ftornero? It's not allowed to use UploadFileSilent in a BC16 extension?
Message in Dutch saying 'This action is not available for the online version of the app.'0 -
Hello @dep_cornator ,
You can use something like that:DirectoryPath := 'C:\run'; fileMgt.GetServerDirectoryFilesListInclSubDirs(TempNameValueBuffer, DirectoryPath); if TempNameValueBuffer.FindSet() then repeat if fileMgt.GetFileName(TempNameValueBuffer.Name) = 'start.ps1' then begin fileMgt.BLOBImportFromServerFile(TempBlob, TempNameValueBuffer.Name); if TempBlob.HasValue() then begin TempBlob.CreateInStream(InStr); InStr.ReadText(qTexto); end; exit; end; until TempNameValueBuffer.Next() = 0;
But the paths and files must be in the server, you don't have access to the client file system, later on with the InStream you can do whatever you want.
Regards1 -
Ok, thx... go try it0
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