I am building a robot which first runs an API call for downloading a PDF file in byte array format. Now my need is to create a PDF file from this byte array to the Remote Desktop. The bot will be running on my local system and then RDPed to another system where this PDF file needs to be saved. Any ideas how that can be achieved?
For the movement of the file create a folder on your RDP machine where you want to save the PDF and then share that folder with your local system, create the bot and then just use the move file activity and provide the folder path of the remote machine folder which you just shared
I am able to create the pdf file using byte array to my local system. The only thing I need to know about is the shared folder thing. I need to know how can we share a remote machine folder with the local machine so that we can save the files there directly when the robot runs. Can you please share any article/blog related to that if possible?
No, there is no built-in command prompt command to create a file from a byte array. However, you can write a simple script in a programming language such as Python or PowerShell to create a file from a byte array.
Hereâs an example script in Python:-
byte_array = [0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64] # Replace this with your byte array
file_name = âoutput.txtâ # Replace this with the desired file name
with open(file_name, âwbâ) as file:
file.write(bytes(byte_array))
This script creates a file named âoutput.txtâ in the same directory as the script and writes the byte array to the file.
Hi @Nitya1 what I did is, created an exe file accepting arguments for custom data and stored it on the remote PC. When the automation runs it opens cmd and run this exe file with the arguments provided. That is still a workaround but served my need!