Upload plugin

Add image uploading to your website, blog or forum by installing our upload plugin. It provides image uploading to any website by placing a button that will allow your users to directly upload images to our service and it will automatically handle the codes needed for insertion. All features included like drag and drop, remote upload, image resizing and more.

Supported software

The plugin works in any website with user-editable content and for supported software, it will place an upload button that will match the target editor toolbar so no extra customization is needed.

  • bbPress
  • Discourse
  • Discuz!
  • Invision Power Board
  • MyBB
  • NodeBB
  • phpBB
  • Simple Machines Forum
  • Vanilla Forums
  • vBulletin
  • WoltLab
  • XenForo

Add it to your website

Copy and paste the plugin code into your website HTML code (preferably inside the head section). There are plenty options to make it fit better to your needs.

Basic options

Button color scheme
Embed codes that will be auto-inserted in editor box
Sibling element selector where to place the button next to
Position relative to sibling element

Advanced options

The plugin has a large set of additional options that allow full customization. You can use custom HTML, CSS, own color palette, set observers and more.

Supported devices

PUP should work in any modern web browser (HTML 5) regardless of the user device (that includes mobile devices). It has been tested and confirmed to work on Windows, Mac, Linux and Android (Chrome).


Basic installation is easy as copy the following code into any HTML section of the target website. You can add custom options right on this code.

Note: You need to edit src and data-url to match your website.

PUP works on the DOM so it doesn't have any server-side dependencies and it can be installed on any website.


All plugin customizations are handled via data attributes that you must add to PUP base code. As an example, to use the red color palette the code should look like this:

This applies to all PUP options. The format is data-key where key is the target option key, in this case the palette option is being declared as the data-palette attribute value.


This is the list of all the plugin key options available.

  • url
    URL of the target Fotoaly website.
  • palette
    Named color palette of the button or a comma-separated list of colors (HEX, RGB, etc.). When using a comma-separated list of colors, the system will bind each color to a %n color index (starting at %1) that you can use with custom CSS. Supported list of palette names: default, clear, turquoise, green, blue, purple, darkblue, yellow, orange, red, grey, black.
  • auto-insert
    Embed codes to auto insert in the target editable content. Default bbcode-embed-medium. Codes using full, medium or thumbnail will link to the image viewer page. Use 0 to disable auto insert. Supported embed codes strings:
    • viewer-links
    • direct-links
    • html-embed
    • html-embed-full
    • html-embed-medium
    • html-embed-thumbnail
    • bbcode-embed
    • bbcode-embed-full
    • bbcode-embed-medium
    • bbcode-embed-thumbnail
    • markdown-embed
    • markdown-embed-full
    • markdown-embed-medium
    • markdown-embed-thumbnail
  • sibling
    Sibling CSS selector to use it as a reference to the DOM node where the button should be inserted. By default, the button will be placed relative to the editable content. When the sibling is defined, the plugin will search for that element and it will use it as the reference for button insertion. Value css-selector.
  • sibling-pos
    Position, relative to the sibling, to place the button. Default after. Values before, after.
  • vendor
    Named vendor string. Default auto. Supported vendors strings: bbpress, discourse, discuz, ipb, mybb, nodebb, phpbb, smf, vanilla, vbulletin, woltlab, xenforo
  • mode
    Plugin mode. By default, the plugin binds to any matching editor box. Use manual mode to explicitly insert the button and stop any automatic binding. Default auto. Value auto, manual.
  • target
    CSS selector for target editable content. Use it when manually inserting the button. Default auto. Value css-selector.
  • lang
    Button language for two-letter and four-letter language codes. Default auto. Supported language strings: ar, cs, de, es, fi, fr, id, it, ja, nl, pt_BR, ru, zh_CN, zh_TW
  • container-class
    Custom button container class name. It binds %cClass to the template stack. By default, the system will use fotoaly-pup-container.
  • button-class
    Custom button class name. It binds %bClass to the template stack. By default, the system will use fotoaly-pup-button.
  • html
    Custom HTML for the button. For more on this, check the custom HTML and CSS section.
  • css
    Custom CSS for the plugin button. For more on this, check the custom HTML and CSS section.
  • fit-editor
    A boolean indicating if the plugin should fit the button to the target editor toolbar. Values 0 (disabled), 1 (enabled). When disabled, the plugin won't fit the button styling to the target editor (override valid only for supported vendors).
  • observe
    CSS selector for elements that on click event will trigger sibling observation and then button insertion. Useful for dynamic editors that generate editor code on the fly. Value css-selector.
  • observe-cache
    A boolean indicating if a matched observed element should be cached. Default 1. Values 0 (disabled), 1 (enabled). When enabled, it will stop observing the matched observed element click events. Always disable observe cache if the editor is dynamically generated and not stored as a DOM node.

Custom HTML and CSS

PUP support custom templates and it includes template placeholders. A template placeholder is a special string that PUP will convert into usable markup. This is the list of template placeholders available:

  • %x
    PUP button observer (must be used to trigger button action)
  • %cClass
    Container class name
  • %bClass
    Button class name
  • %iClass
    Icon class name
  • %iconSvg
    Vector icon in the form of a ready-to-use SVG HTML tag
  • %text
    Translated button text

For custom CSS, you can also use color palette placeholders in the form of %n where n is the color palette index so it binds %1, %2, ..., %n placeholders.

Custom HTML works by indicating the template string as an option attribute. In this example, this is the custom HTML that we want to use:

<a %x title='%text' class='%bClass'>%iconSvg</a>

To use this template, simply assign data-html right into the plugin code:

Custom CSS works exactly the same as custom HTML but it uses data-button-css and color palette placeholders (%1, %2, ..., %n). In this example, this is the custom CSS that we want to use:

To use this template, simply assign data-css right into the plugin code:

Important: For both custom HTML and CSS make sure to don't break the syntax when using quotes.

Manual button binding

To manually bind a button, simply create your own button make sure to add data-fotoaly-pup-trigger and data-target attributes. This is an example of a manually inserted button:

<div id="editor" contenteditable></div>
<button data-fotoaly-pup-trigger data-target="#editor">Custom button</button>

Manually inserted buttons get the same popup dialog functionality and binding. However, manually inserted buttons won't use any of the plugin options or templating.

Core features

This plugin has very neat functions and takes advantage of modern standards to provide its core functionality. These are some of the features shape the PUP core.

Native JavaScript

PUP is written in modern JavaScript standard and it doesn't require any external library or server module. The code is about 18KB and gzipped should be around just 6KB. The source is minified using Google Closure compiler but object names aren't touched so you can inspect the source and easily understand the code.

It works async so it doesn't matter where you place the insertion code and it won't render block the load of the target website at all.

Smart load and dynamic trigger observer

PUP is designed to observe the DOM until the target sibling element is available and soon as that happens, it will initiate its process and it will stop any additional DOM node observation. For dynamically generated editor boxes, PUP has a complimentary load option that observes the click event on a defined selector element. Any click on that element will trigger PUP's sibling observation and it will stop soon as the sibling gets found. This allows PUP to work in static or dynamic editor boxes.

Since some dynamic editor boxes will be generated just once and then stored as DOM nodes (XenForo) and others will be always re-parsed (Discourse, NodeBB), you can indicate if PUP should cache or not the observed triggered bindings. XenForo, Discourse and NodeBB vendors are configured to observe certain selectors just in case you want to learn how this works.


The source is all wrapped in a JavaScript closure meaning that the internal variables can't be tempered. This aims to avoid hijacking via browser console exploits or DOM manipulation. This closure also grants that all the variables handled by PUP won't conflict with any of the scripts running on the target website.


PUP uses postMessage API to keep an active communication with the target Fotoalywebsite. Options and embed codes are safely handled using this API which restricts the origin of the posted messagese and on top of that, PUP validates each message to ensure that there's no tempering on those either. PUP will only listen to messages from the target Fotoaly website.

Multiple instances

PUP supports multiple unlimited instances. You can cast multiple buttons at the same time and all instance ids are referenced using the GUID algorithm.

Template cache

PUP will cache the button template so it won't unnecessarily re-process the template placeholders. This grants super fast performance even in multiple instances.

Edit or resize any image by clicking the image preview
Edit any image by touching the image preview
You can add more images from your computer or add image URLs.
You can add more images from your device, take a picture or add image URLs.
Uploading 0 image (0% complete)
The queue is being uploaded, it should take just a few seconds to complete.
Upload complete
Uploaded content added to . You can create a new album with the content just uploaded.
Uploaded content added to .
You can create a new album with the content just uploaded. You must create an account or sign in to save this content into your account.
No image have been uploaded
Some errors have occured and the system couldn't process your request.
    or cancelcancel remaining
    Note: Some images couldn't be uploaded. learn more
    Check the error report for more information.