Upload files from folders and sub-folders to webapp
desktop-application, file-upload, macos, ruby-on-rails, windows
Solution
I would recommend creating an Adobe Air app.
You can reuse your existing plupload js code, and extend it with adobe air apis. Ideally, it would be a mostly static app but make a server call to create the policy document, and do any book-keeping you want to do on the uploads. Take a peak at Accessing AIR API classes from JavaScript. Then look into the filesystem.File class.
Flash has something like a 99.3% penetration, and with it the user just clicks "Install My Uploader" and the air framework is automatically installed if needed. Air is also on Android and iDevices, so your app would probably be available to 99.999% of users and their moms.
It took me a minute to find it, but here is the Adobe® AIR® API Reference for HTML Developers
Oh look what I found in their examples:
var directory = air.File.documentsDirectory;
try
{
directory.browseForDirectory("Select Directory");
directory.addEventListener(air.Event.SELECT, directorySelected);
}
catch (error)
{
air.trace("Failed:", error.message)
}
function directorySelected(event)
{
directory = event.target ;
var files = directory.getDirectoryListing();
for(var i = 0; i < files.length; i++)
{
air.trace(files[i].name);
}
}
Problem
Goal: Allow user to select a folder, then find all files recursively that matches a file pattern and transfer(POST) to my web server In essence just a more advanced upload dialog... Standard web technology (we're using plupload) doesn't support this, due to security reasons, afaik. Additional requirements: Easy to use/install from the webapp. SSL and and app user credentials are needed. Some other data like record ID (get or create from web app) to associate the upload files would be nice. The web app itself is written in Ruby on Rails, but that shouldn't really matter if I need some kind of a native Mac and Windows (=80% of my users) desktop client. What are my options? Code and references to open source libs for doing this is a bonus.