Seaside wrapper for Filepicker.io
Written on September 26 2012.
This blog post was written a long time ago and may not reflect my current opinion or might be technically out of date. Read with a grain of salt.
To me, uploading has always been the messier part in web application. Some will argue that the fun starts when you want to do ajax uploading.
Filepicker.io solves the problem quite elegantly. Mega bonus point, they integrate nicely with Dropbox, Gmail, Google drive, Facebook and others. So your user can pick a file on her hard drive, dropbox or even take a picture with the webcam.
The integration is pretty straightforward but to make things even easier I’ve started a small wrapper for Seaside. You can find it on Squeaksource 3. Right now, it only performs the basic but I’ll add features when I need them.
html form with: [
on: #uploadedFileUrl of: self;
html submitButton with: 'Send the form.'
When the user selects a file and sends the form, the instance variable `uploadedFileUrl` will contain the url of the uploaded file. You can then grab it and do whatever you want with the file.
You can grab the `Filepickerio-Test` package in the repo, it contains a sample application showing how to use it.
I’ve only tested on Pharo 1.4 Summer edition and Seaside 3.0.7. The code is quite simple and should work everywhere though…
Oh, the repo is global read/write and the code is MIT ;)