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.
Go to Site Tools > Site > File Manager. Navigate to the folder in which you want to upload in the folder/file tree on the left. Click the File Upload or the Folder Upload icon in the upper toolbar and choose the upload item from your computer.
Upload files & folders On your computer, you can upload from drive.google.com or your desktop. You can upload files into private or shared folders. On your computer, go to drive.google.com. File Upload or Folder Upload.
Select the file(s) or folder you'd like to upload. You can select multiple files for upload by holding the Command or Control key (Mac or Windows, respectively) while selecting files. However, you can only select one folder at a time for upload.
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);
}
}
I would build a client starting from something like this: https://github.com/ms4720/s3sync so that you can keep it in the ruby family. If you need a friendly gui: http://shoesrb.com/tutorials/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With