SUPA - The Screenshot UPload Applet
Intendet audience: Developers
Supa is intended to make uploading screenshots to websites a whole lot easier.
Upload images The Supa Way
- Go to webpage and paste the image directly
- Be Happy
The Olden Way:
- Save screenshot (or some other image) from your clipboard to file
- Open webpage
- Search for the file you just saved
This applet is no standalone product but intended to be included in your own application.
Unfortunately, this exquisite usability enhancements comes at a price. Local clipboard access is denied for security reasons and as such is not accessible through "normal" web methodologies.
Supa is implemented using a signed Java Applet (Java-Plugin 1.6 required). This allows for local clipboard access but requires developer/administrator action on deployment
Furthermore the end user usually has to manually accept the signed java applet at lest once. In a controlled environment this might be worked around by an administrator, see Installation
Integration in your project
- void pasteFromClipboard()
- void clear()
- String getClipboardContents()
Get the image from the applet using getClipboardContents() and post this to your website.
The provided java applet (the .jar file) is signed to enable local clipboard access. However, the certificate used is publicly available through the project Subversion repository and must not be used in a production environment
. See the official documentation
about signing java applets.
This method retrieves the current clipboard content into the applet.
Clear the current image.
The return value of this method is a (usually) base64 encoded string representation of the image that was pasted using pasteFromClipboard().
These are the applet initialization parameters:
If set to true, clicking on the applet pastes the clipboard content.
The pasted image will get converted to this image format.
Supported values (atm): "jpg", "png"
This determines the encoding used by method getClipboardContents().
Supported values (atm): "none", "base64"
previewscaler (string="fit to canvas")
In which way should the preview be scaled.
Supported values: "fit to canvas", "original size";
Do some output on the java plugin console. Intended for debugging purposes only.
Have fun using this applet in your projects and drop me a note if you liked it...