FileMobile Joomla Module

In Joomla CMS, modules are widgets that reside on the pages and serve a certain purpose. I created a module, which uploads media files to a FileMobile storage accessible via RESTful API.

Features:
1. Allows to upload several files simultaneously (drag-and-drop option included).
2. Displays thumbnails.

Here’s how it looks like on a page:

I’m sure you’d be happy to hear some technical details. The uploading process is done via XMLHttpRequest. I have a <input multiple=”multiple” type=”file” /> tag in the HTML body, and once it changes (a file is being selected through it), a FormData object is being created and sent via XMLHttpRequest POST request, for which I explicitly define in the headers sent:

X-Requested-With: XMLHttpRequest

Uploading files that way directly to FileMobile is something what you would have expect from the module (and that’s how it was planned originally). However, it turned out that FileMobile’s API has certain restrictions. They’re probably expecting a multipart request (Content-Type:multipart/form-data) and might be filtering AJAX requests out. That imposes some weird limitations on my module as well: it has to cache files on the Joomla server, will not let to upload files bigger than PHP allows, etc. Looking forward to FileMobile’s team fixing their API so that the module gets rid of those limitations.

The PHP code utilizes Facade, Singleton and Factory patterns.

The module was written for a private client and will not be publicly available.

Product Details
Name: FileMobile Joomla module
Programming languages used: PHP, Javascript/jQuery
3d-party libraries used: FineUploader
Type: add-on
Framework/Platform: Joomla CMS 2.5/3.0
Budget: 9 hours
Release: March 2013.

Discuss