Plupload HTML web upload dialog control for Xojo Web.
Special thanks to @Alexander Marthin @ Lumafilm.dk for sponsoring this project and generously donating it to the Xojo community.
Plupload is a widely used HTML/javascript web upload control facilitating the upload of large files via the web browser. The Xojo Web upload control is not well equipped for large files or when being used in a CGI environment.
Our objective here was to implement a web dialog control that presents a fully featured upload control powered by Plupload. Plupload can upload to any web server but by default provides a PHP script to facilitate file uploads. This repository contains a “www” folder which are the scripts and assets that need to be uploaded to your web server in order to facilitate the uploads. The “www/uploads” folder is where files are saved upon upload (configurable - see below).
To use in your Xojo Web project you want to copy the “Plupload” dialog control to your project. See the “btnShowUploader.Action” event in the example project for details on how to instantiate, configure, and show the control.
It requires a web server that can utilize PHP. Plupload is basically used it conventionally is: loaded from HTML and then performs upload through PHP script. PHP uploads are very fast and reliable compared to Xojo Web. Plus Plupload provides a very clean upload user interface as opposed to the very limited Xojo Web one.
So ideally you have a web server that can handle PHP. You upload the contents in the “www” folder to it. You then drop in the plupload dialog control into your Xojo Web app. You point it to wherever the “www” folder contents are and it should load up and work fine.
Hmmm… Got plupload.php running on a stand-alone server successfully, but when I try to point the same app at it, clicking the button just gives me a javascript error:
Could not execute returned javascript: $(…).plupload is not a function
I made no changes to the sample app other than putting myserver name in the _uploader.URL = “https://myserverhere/” line
There are three lines that have “localhost:8888” hard-coded into the app’s HTMLHeader property. I had to change those three references so that they point at the correct URL and port on the actual php server that’s hosting plupload (since it isn’t the same server).
Once I found and changed that, it worked great! You may want to add a mention of that to the readme file! Thanks again!