I searched online but couldn't find exactly how to do this.
We want to upload a logo image file to replace in the disclaimer page. But want to do it from TFTP or SFTP via CLI. Does anybody have the command and destination folder in the FGT's filesystem?
Thanks,
Toshi
Solved! Go to Solution.
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
Hi Toshi,
you can just base64 encode your image and paste it into your Fortigate configuration via CLI as shown bellow:
config system replacemsg-image
edit "ftnt-logo"
set image-base64 "iVBORw0KGgoAAAANSUhEUgAAAeYAAAFbCAMAAAA3Gd1WAAAAGFBMVEVHcEzOOynNPCrLPCzPOyvNOyrNOyrNOyq5BoQ2AAAAB3RSTlMAwH8/F+ybGzko3AAABgBJREFUeNrt3Qty2zYUQFHiQ2L/O+5UTSdtbCuSLAAPyLkb0BseAwRpj3wc0tflK72566HPTSF6aNby/o8tdSBxzam9v/TQZ7cQPTRr6fLJeZB0uc55l+6PZz7beZUBm3Waeun+eOZ/Pr4zdDknXzrMPxZ1R+iSpl86zL1XdE0BLh3mn109DmP5bJhDMbczr7aUMb82R11rKWOefxSrV5hLh/nDHXqhDRvz9I27nA1zYOb3bNw51KXD3OfEXRrm6Mzfd84Nc3zm1r63b18N8xLMLS+ijHnWes4N8zLML6/n0jAvxPziei4N81LMLzmPeiuCeeZ7kno2zIsxt/Pp956pYV6O+cFrOOlRCvPbugI/SmGecwwbfvzCPOP2nBrmRZmfuD3nhnlZ5offhpWGeWHmR2/PCfPSzCnwlo157LZdGubFmVsNu2VjHjpebpiXZ/7tKayemDdgPsMuZszjTmETFzPmce88r4Z5C+a7v6qqDfMmzPceqi7M2zBfMRcz5lHL+cK8EfMVcjFjHnTYzph3Yv7i2XnmMzPmYa/CcsO8FfPny/nEvBlzWmUozN+qRHuawjzmmao2zNsxf3ymypj3Y/54CEuYN2RO4fZszD2q0fZszAN27RPzlswp+ESYO+zaGfOmzDnWORtz/0lrw7wp83937Yx5W+Yc6H025m5doR6nMHfqDDYP5j6VULdmzL1vzgnzxszXgpcO88s354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bxjzyxjztV1WY39B1PFfCvCBzelJ5wtMz5rE35knHMMzfVi7H82XMizG/ojx8TMzD3ovMXM+YZ6zl4Y9VmKes5dHOmOes5cH7NuZJa3msM+ZZa3no8zPml5+X83Es44x55FuRT957JsyBmVM93lO9MIdlvo73NWLjxjxvwx64cWOeuGH/fLI6MQdjfssJe/QdGvOzd+V6dKkkzGGYUzm61fMohjkIct8VjTkM8m3668Q8kfm8BiDfDmO5S48d+GMU/TL90l8ByO/V46UaMQAAAABJRU5ErkJggg=="
next
end
Hi Toshi,
you can just base64 encode your image and paste it into your Fortigate configuration via CLI as shown bellow:
config system replacemsg-image
edit "ftnt-logo"
set image-base64 "iVBORw0KGgoAAAANSUhEUgAAAeYAAAFbCAMAAAA3Gd1WAAAAGFBMVEVHcEzOOynNPCrLPCzPOyvNOyrNOyrNOyq5BoQ2AAAAB3RSTlMAwH8/F+ybGzko3AAABgBJREFUeNrt3Qty2zYUQFHiQ2L/O+5UTSdtbCuSLAAPyLkb0BseAwRpj3wc0tflK72566HPTSF6aNby/o8tdSBxzam9v/TQZ7cQPTRr6fLJeZB0uc55l+6PZz7beZUBm3Waeun+eOZ/Pr4zdDknXzrMPxZ1R+iSpl86zL1XdE0BLh3mn109DmP5bJhDMbczr7aUMb82R11rKWOefxSrV5hLh/nDHXqhDRvz9I27nA1zYOb3bNw51KXD3OfEXRrm6Mzfd84Nc3zm1r63b18N8xLMLS+ijHnWes4N8zLML6/n0jAvxPziei4N81LMLzmPeiuCeeZ7kno2zIsxt/Pp956pYV6O+cFrOOlRCvPbugI/SmGecwwbfvzCPOP2nBrmRZmfuD3nhnlZ5offhpWGeWHmR2/PCfPSzCnwlo157LZdGubFmVsNu2VjHjpebpiXZ/7tKayemDdgPsMuZszjTmETFzPmce88r4Z5C+a7v6qqDfMmzPceqi7M2zBfMRcz5lHL+cK8EfMVcjFjHnTYzph3Yv7i2XnmMzPmYa/CcsO8FfPny/nEvBlzWmUozN+qRHuawjzmmao2zNsxf3ymypj3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mPjtjfuczc707Wsa8BXO+P9rE5Yx52GKeuZwxv6/y2+ES5uWZU+DhMA95mJq9bWMedP6aewrDPPRCzhoP87Dz18xtG/PALXveaRvzyC37NuCJeVHmsz7OPGXbxjzyxjztV1WY39B1PFfCvCBzelJ5wtMz5rE35knHMMzfVi7H82XMizG/ojx8TMzD3ovMXM+YZ6zl4Y9VmKes5dHOmOes5cH7NuZJa3msM+ZZa3no8zPml5+X83Es44x55FuRT957JsyBmVM93lO9MIdlvo73NWLjxjxvwx64cWOeuGH/fLI6MQdjfssJe/QdGvOzd+V6dKkkzGGYUzm61fMohjkIct8VjTkM8m3668Q8kfm8BiDfDmO5S48d+GMU/TL90l8ByO/V46UaMQAAAABJRU5ErkJggg=="
next
end
Oh, I see. I'll test it today.
Thanks,
Toshi
Created on 05-06-2022 02:24 PM Edited on 05-06-2022 02:24 PM
Yes it worked. I used a tool at https://www.base64encode.org/ convert it to Base64 format and just pasted it in CLI as you showed.
Thanks again,
Toshi
Just FYI to everybody. But my objective when I asked this question was to compose desclaimer captive portal HTML with a customer's logo for FAP's guest wifi SSID originally copied from Meraki MR guestWiFi SSID, which I just completed today.
There are many gotchas to accomplish all of these via CLI so that we can copy and paste to multiple FGTs. Some keys were below:
1. In the html, you can show the image only via "background" or "background-image" property in CSS on an object. You can't use <img src="image_file_source"> to load it as an object in foreground, unlike Meraki.
2. In CLI under "config sys replacemsg-group" where you set your own htmls for each type of page, you need to escape special characters like ', ", etc. with '\'. Also '?' in a string doesn't show up in the final result unless you use ?.
3. You can upload/configure only 2 additional images because the limit is 8 and already 6 images by default.
I had to figure these out without help from TAC because they say "we're network engineers not html coders". I told them "I'm an network engineer too".
Toshi
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1536 | |
1029 | |
749 | |
443 | |
210 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.