Good evening everyone.
Please help me to upload the content of a text file via the fetch tool. I have been trying and failing constantly.
The code I’m using is as follows:
I’ve tried to save to file but was unsuccessful, I read on the forum that this is because the ROS only reads files up to 4096B, so I used this variable “s”. Needless to say, I was not successful. Any help is welcome.
I think the main issue in your method is not the post itself, rather, the collection of data. :execute runs something in the background with no interaction with the current terminal session. print only echos to the terminal. You cannot save the print output or pass it elsewhere without using as-value, which returns an array of dictionary items.
The print to file would work but is limited to RouterOSs stupid 4096 byte limitation when working with files. If your arp table’s output is larget than 4096 characters it won’t load it back.
You can use something like this.
{
local data [/ip arp print as-value]
/tool fetch url="https://ptsv2.com/t/fwdrm-1636572193/post" http-method=post http-data=$data http-header-field="Content-Type: text/text"
}