Forum Discussion
Eric_Frankenfie
Jul 10, 2014Nimbostratus
Serve Status Page with Images on LTM v10.2
We utilize IP ACLs for a number of our virtual servers and need an easy way for users to identify their source IP address so that we can update our data groups. The traffic is a mix of Internet and ...
Kevin_Stewart
Jul 10, 2014Employee
Can I just base64 encode the single image and then reference it in my HTTP::respond?
Of course. The data group is just a place to store the information, but you could just as easily include that "string" directly in the iRule.
when HTTP_REQUEST {
if { [HTTP::uri] equals "/myimage.png" } {
set img "...base64-encoded image data..."
HTTP::respond 200 content [b64decode $img] "Content-Type" "image/png"
} else {
HTTP::respond 200 content "...some HTML that includes an image src tag for /myimage.png..."
}
}
Or, if you wanted to get really crazy and not require a second request for the image, you could include the data inline in your HTML response:
img src="data:image/png;base64,...base64-encoded image..."
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects