Add ajax file upload #745

Open
mbk opened this Issue Nov 29, 2010 · 11 comments

Comments

Projects
None yet
6 participants
Member

mbk commented Nov 29, 2010

Add Ajax file upload capabilities to SHtml, preferably using http://valums.com/ajax-upload/ as a front-end "working use case".

SHtml calling interface could be:
def ajaxFileUpload(func: (FileParamHolder) => Unit, jsFunc : Call, func : (String) => JsCmd, attrs : (String, String)*)

This would be consistent with other ajax interfaces and with file upload (non-Ajax).

Member

mbk commented Dec 1, 2010

See also plupload.com for nifty upload examples.

Member

mbk commented Jan 23, 2011

This one might relate to the now fixed raw access to post data for use cases with XHR HTML5 blob uploads.

Owner

dpp commented Jan 26, 2011

We can't use Valums because the code is GPL.

I have to do more research into MIT or Apache plugins that we can use

Member

mbk commented Jan 26, 2011

I found this one http://aquantum-demo.appspot.com/file-upload and am trying to get that one working today. Once I'll do I push it to a self-contaned git repo on github. MIT licensed, so should be good(?).

Member

mbk commented Jan 27, 2011

Done. Check out https://github.com/mbk/ajaxupload_with_comet

Contains a /devtest link that includes the above mentioned UI as plain html/JS, and uploads to a DispatchPF. Works like a charm, how can I help to wrap this up?

Member

mbk commented Mar 17, 2011

I am in Norway until Saturday, but may have some spare time left; if you post me the example of one comet actor providing feedback (I think you made a project for that a few weeks ago, but can't find the thing from here), I'll try and write:

a) a complete piece of code in a blank project that does an Ajax upload with feedback and executes a function on upload

b) at least write in the Wiki "how it's done"

c) Maybe you'll see a quick way to "collapse" the code into a function on SHtml

dpp was assigned Mar 1, 2012

Owner

Shadowfiend commented May 10, 2014

There's some room to roll this into Lift by simply using the iframe-based upload mechanism that is the standard fallback for AJAX file upload and requires no external dependencies. See https://groups.google.com/forum/#!msg/liftweb/OuN1sqRMO_c/TrUGUaSvoN4J for more. The Lift Cookbook also includes alternate approaches guidance at http://cookbook.liftweb.net/#AjaxFileUpload .

I'm eyeballing adding the iframe approach to Lift 3 to avoid external libraries, and letting folks do it via plugins if they want more functionality.

@Shadowfiend Shadowfiend assigned Shadowfiend and unassigned dpp May 10, 2014

Shadowfiend added this to the 3.0-M1 milestone May 10, 2014

Shadowfiend added the WebKit label May 10, 2014

Owner

davewhittaker commented May 12, 2014

@Shadowfiend It seems like there is File API support in at least the latest release of all major browsers. Should we be forward looking with Lift 3 and concentrate on that rather than an iframe based approach?

Owner

Shadowfiend commented May 12, 2014

It's a question I'm still noodling, but my feeling is that we should be forward-thinking on the server-side, which we control completely, but be a little more deliberate about client-side decisions. It'd be nice if out-of-the-box solutions could at least be compatible through IE8 when it doesn't take too much hackery. Even IE9 doesn't support the file API.

To me, the key is that there be minimal work on Lift's side… The iframe solution is actually, IMO, simpler than the File API solution or anything else, because it will actually require no JavaScript from us if we do it right. It will also be less featureful (File API provides progress updates and such), but if you want those things you could just pull in a JS plugin and do it with the File API.

Net-net, I'm a little torn on it. Maybe one possibility would be providing both and letting the developer choose.

Member

farmdawgnation commented May 12, 2014

This is something that could be configurable as a LiftRule if we provide both. Something like “use the file API if the browser supports it” with auto-fallback to iframe on the IE’s where it’s needed.

@farmdawgnation farmdawgnation modified the milestone: 3.0-M2, 3.0-M3 Nov 26, 2014

@Shadowfiend Shadowfiend modified the milestone: 3.0-M4, 3.0-M3 Jan 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment