how to transfer image file from one node to other?

+3 votes

Hi, i am working on windows server and i faced an issue while trying to transfer one image file (40kb size) from one node to other.

we got below error while trying to publish hexadecimal value of password protected file into items stream:

command: multichain-cli chain1 publishfrom 1YdiZtswNLfJ23NJkjqxLLRx7LLJzzZDnDf7Xr items secret-cpuinfo $cipherhex

Error:error code: -8
error message:
Item data should be hexadecimal string

 

on doing further analysis we realized that the hexadecimal value of image file is coming out to be very large which eventually is not getting stored completely in shell variable in cmd.

openssl enc -aes-256-cbc -in C:\Users\amkhurana\Documents\MultichainSetup\Ak.jpg -pass pass:%password% | xxd -p -c 99999

 

commands are working fine to transfer txt file since its hexadecimal value is small but for image its getting failed. Please help!

asked Oct 24, 2018 by AmitKhurana

1 Answer

0 votes

First, sorry for the delayed reply – this slipped through our usual monitoring process.

I think the problem here is that you are using a Linux-formatted command line variable $cipherhex on a Windows computer, and it is not substituted in the same way.

On Windows you can read a file into a variable using this method:

https://stackoverflow.com/questions/6359820/how-to-set-commands-output-as-a-variable-in-a-batch-file

Then you use the %cipherhex% format instead of $cipherhex for substitution.

answered Oct 31, 2018 by MultiChain
...