XML Configuration Reference
Most of the Image Uploader configuration depends on the XML configuration file. This document explains all XML tags and their values you must or may set.
Note: All tags are mandatory, unless stated otherwise.
configuration
This tag is mandatory and encapsulates all other tags in the config file. Syntax:
<configuration>
...
</configuration>
verification
The verification tag is used much like a serial number to authorize licensed use of the Uploader (you will get one after purchase). Up to three verification tags are allowed so that you can use multiple domain aliases for your website.
Note: if you need more aliases, please contact us and request an alternate version of the SWF file.
Note 2: no whitespace (spaces, line breaks etc.) is allowed between the opening and closing tags.
Syntax (with sample verification code):
...
<verification>3f56c4a928173967220d31ed9e78c00666d881f7918a5148f21f88cedfd3e933</verification>
...
maxwidth, maxheight, minwidth, minheight
These tags determine the dimensions of the final image. The images are normally resized according to their aspect ratio, but if one dimension reaches the maximal value and the other would be below the minimal value, the min value will be used (and vice versa). If you don't want small images to be scaled up, simply set the minimal values to zero. If you want, on the other hand, to resize the images to a fixed format (e.g. square thumbnails), set both the minimal and maximal values equally. Syntax:
...
<maxwidth>800</maxwidth>
<maxheight>500</maxheight>
<minwidth>100</minwidth>
<minheight>70</minheight>
...
compression
The compression tag sets the compression factor of the final JPEG image. Possible values are 0 (for no compression) to 100 (maximal compression). The lower number you set, the higher image quality and file size. Syntax:
...
<compression>12</compression>
...
thumbnail, filename
Possible values yes or no. If enabled, a small thumbnail image will be displayed on the left side of the Uploader element when the user chooses an image. The longer dimension of the thumbnail is determined by the height of the Uploader element.
The filename tag enables or disables the display of the chosen file name in a similar way. Syntax:
...
<thumbnail>yes<thumbnail>
<filename>no<filename>
...
statusbar
Yes or no again. Enables/disables a tiny color bar in the bottom of the Uploader element (red when resizing, moving yellow when uploading and green after a successful upload). Syntax:
...
<statusbar>yes</statusbar>
...
submitmethod
There are two possible values - immediate and javascript. If set to immediate, the image is simply uploaded immediately after chosen and resized (and the page redirected depending on the afteraction tag). If you set the value to javascript, the JavaScript interface is enabled and you can control the upload with a simple JavaScript call (see the JavaScript Interface section of the documentation). Syntax:
...
<submitmethod>immediate</submitmethod>
...
choosetext
The value of this tag will be displayed in the "choose file" button. That allows you to customize the uploader for various languages etc. Syntax:
...
<choosetext>Choose Image</choosetext>
...
bgcolor, filetextcolor, buttonbgcolor, buttontextcolor
You can completely customize the User Interface colors with these tags. Bgcolor sets the background color of the Uploader element, filetextcolor the color of the file name (if enabled), buttonbgcolor determines the background of the "choose file" button and buttontextcolor the color of the text displayed over it.
The colors are set in the hexadecimal RGB format (like that in HTML, but without the # sign). The background colors support an additional value transparent (wmode must be set to transparent in the HTML/JS integration code if you want the Uploader element to have a transparent background). Syntax:
...
<bgcolor>eee0c0</bgcolor>
<filetextcolor>646464</filetextcolor>
<buttonbgcolor>transparent</buttonbgcolor>
<buttontextcolor>323232</buttontextcolor>
...
bgimage, buttonbgimage
These tags allow you to specify an image background for the Uploader element and for the "choose file" button to customize the Uploader even more. The background images should be in PNG (24-bit and alpha channel supported) or JPG format. The Uploader element background image represented by the bgimage tag should be of the same size as the Uploader element and the button background image should match 100*24 pixels. You can specify either relative or absolute URLs of the images. The two tags are optional. Syntax:
...
<bgimage>background.png</bgimage>
<buttonbgimage>http://resize-before-upload.com/sample/buttonbg.png</buttonbgimage>
...
scripturl
This tag is highly important as it specifies the URL of the server-side script that receives and saves (or otherwise processes, depending on your actual script) the final image. Syntax:
...
<scripturl>uploadimage.php</scripturl>
...
afteraction
Another URL, but this one is optional and specifies an URL to be redirected to after a successful upload. Leave blank for not redirecting anywhere. Syntax:
...
<afteraction>showimage.php</afteraction>
...
idvariable
The name of the GET variable sent along the image to the receiving server-side script that is used to identify the uploaded image, assign it correctly to a database entry etc. The value of this variable can be set either in flashVars (see the HTML/JS Integration section of the docs) or in the XML file (tag idvalue). Syntax:
...
<idvariable>imageid</idvariable>
...
idvalue
The value of the variable set in the idvariable tag. If the IDValue variable in flashVars set to xml, the value from the idvalue tag will be used, otherwise the script will get the flashVars IDValue value (see the HTML/JS Integration section of the docs). Syntax:
...
<idvalue>myImage003</idvalue>
...
getvariable, getvalue
These two tags are used in pairs when you need to pass the server-side script more than one variable. Getvariable specifies the variable name and getvalue its value. Syntax:
...
<getvariable>userID</getvariable>
<getvalue>123456</getvalue>
<getvariable>userLanguage</getvariable>
<getvalue>EN</getvalue>
...