Forum Discussion
Problem with b64decode lindex in Version 10.2.1
I would like to send a sorry page when all pool members are down. I found a solution contributed by citizen_elah .
1. Generate base64 encoded file from a screen shot .
2. Remove the newlines from the file
3. Copy the file to /var/class/
4. Create a DataGroup Extern File Type String , Mode ReadOnly (Version 10)
5. Apply the rule to the virtual server
Anything is working fine in version 9.4.7 but not in version 10.2.1 Hotfix-3.
when HTTP_REQUEST {
if {[active_members myPool] == 0} {
HTTP::respond 200 content [b64decode [lindex $::sorrypage_class 0]] "Content-Type" "image/png" }
}
}
In Version 10 I tried to access the lindex with $:: and without both was not working.
In Version 10.2.1 I always got the error message:
TEST_maintenance_site - conversion error invoked from within "b64decode [lindex sorrypage 0]"
I also tried to decode the file at rule init.
when RULE_INIT { log local0. "[b64decode [lindex test_base64 0]]" }
Produced this error: local/tmm err tmm[4831]: 01220001:3: TCL error: Test_base64_File - conversion error invoked from within "b64decode [lindex $::test_base64 0]" Encoding and decoding under linux with base64 works fine.
Any idea how to solve this ?
Thanks.
Regards Klaus
- hoolioCirrostratusHi Klaus,
- Klaus_Gerthein1NimbostratusHi Aaron,
- greenasp_41938NimbostratusI have tried every combination possible and can get an image to display. I placed the images in the data group list as a string, but the images do not get displayed. However, the rest of the page shows.
The website is offline for scheduled maintenance. We apologize for any inconvenience.
We expect to be online shortly. Please check again in a few hours.
- greenasp_41938NimbostratusI have tried every combination possible and can get an image to display. I placed the images in the data group list as a string, but the images do not get displayed. However, the rest of the page shows.
The website is offline for scheduled maintenance. We apologize for any inconvenience.
We expect to be online shortly. Please check again in a few hours.
- greenasp_41938NimbostratusI have tried every combination possible and can get an image to display. I placed the images in the data group list as a string, but the images do not get displayed. However, the rest of the page shows.
The website is offline for scheduled maintenance. We apologize for any inconvenience.
We expect to be online shortly. Please check again in a few hours.
- Kevin_StewartEmployeeI would recommend a slightly different approach. Create a single data group with all of your base64-encoded image content, indexed with the name of the image.
if { [HTTP::uri] ends_with "/logo.png" } { HTTP::respond 200 content [b64decode [class lookup "logo.png" image_class]] "Content-Type" "image/png" }
- greenasp_41938NimbostratusI get this error:
- Kevin_StewartEmployeeApologies. I should have been more explicit. The "image_class" string is the name of a string-based class. Assuming you've created a separate class for each image, this new class can hold all of your images.
- greenasp_41938NimbostratusThanks! It actually worked for the first time..... I was setting the data objects up wrong.
Recent Discussions
Related Content
* 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