For some time have been looking for a solution on how to upload a file into BLOB with RTC Client. The built in functions, UPLOAD and UPLOADINTOSTREAM both force an Open Dialog unless you first copy the file to a temporary path. I already had the file name and wanted to skip that part.
I always stopped on the fact that I was unable to move binary data with code from the client layer to the server layer. Then today, I finally got an idea on how to solve this. I convert the client file to a base64 string, transfer that string to the server layer and save as a file. Then I create a binary server file based on the base64 server file. That file is identical to the client file and ready to be imported into BLOB on the server side.
[code htmlscript=”false”]IF ISSERVICETIER THEN BEGIN
ServerBase64FileName := ThreeTireMgt.ServerTempFileName(”,”);
ServerDocumentFileName := ThreeTireMgt.ServerTempFileName(”,”);
END ELSE BEGIN
This should support files upto 1.5GB in size.
5 Replies to “Loading a client file into BLOB with RTC Client”
Nice! I wonder why something similar has not been included to Company Information page by default.
Hi, could you attach C/AL Local declaration please?
Hi, Thank you very much. Please could you attach C/AL Local Declaration please?
You should be able to download the attached file (https://dynamics.is/?attachment_id=531) and in there you should find both fob and txt objects.
Many thanks for your post. It helped me add the functionality in a NAV2016 system. I only had to make a few changes to the code you posted.