Uploading from the Clipboard using STRG+V

34 views
Skip to first unread message

Stefan Haslinger

unread,
Jan 30, 2014, 8:23:24 AM1/30/14
to hobo...@googlegroups.com
Hi folks,
  • A customer wants to have a quick way to upload files in a rail time consulting situation. He captures images with a screen capture utility and wanted to upload them as quick as possible.
  • In Hobo you achieve that with an extra JS-Library called Fineuploader. It provides upload using drag and drop and pasting.
  • This is not Hobo only, but my approach (mis?)uses a lot Hobo features. All Code can be found in the Gist.
  • Be aware, the library provided is GPLv3'ed, but you could buy a commercial License at Widen's site. (I'm not affiliated with them in any way).
  • You can always compile the latest version of the library yourself, if you have some knowledge of NPM and Grunt, I leaned it in an hour.
  • Fineuploader, does not now about Rails, so I taught it about CSRF in conversation.dryml 20-22 and 35-37, otherwise my requests would not be authenficated.
  • You can name any HTML Element as a paste target using it's id (line 33).
  • I want the sales agent to provide a file name, so I prompt for it (line 34).
  • It calls a Hobo transition (this gives me authorization Hobo style), but via POST, so I need an extra route.
  • The params provided are not Paperclip style, so I help a little bit with the file name (btw. the same approach is useful, if you upload from the file system in a rake task).
  • Fineuploader wants a Json response (conversations_controller line 16) to be able to give a success message after upload.
  • Some things can be improved easily, like using the assets pipeline or error handling, but I'm lazy here and just wanted to share the principles :-)

Bye,
Stefan

Stefan Haslinger

unread,
Jan 30, 2014, 8:24:54 AM1/30/14
to hobo...@googlegroups.com
I forgot: works in Firefox and Chrome on Linux and Win, but not on IE in Win.

Ciao,
Stefan

Ignacio Huerta

unread,
Jan 30, 2014, 10:10:13 AM1/30/14
to hobo...@googlegroups.com
Nice work, thanks for sharing. I think I'll give it a try soon :).

Warm regards,
Ignacio

El 30/01/14 14:24, Stefan Haslinger escribió:
> --
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hobousers+...@googlegroups.com.
> To post to this group, send email to hobo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hobousers.
> For more options, visit https://groups.google.com/groups/opt_out.

--
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

Albert Chou

unread,
Jan 30, 2014, 10:29:40 AM1/30/14
to hobo...@googlegroups.com
Not to belittle the work you've done, but https://github.com/blueimp/jQuery-File-Upload is MIT licensed.  Of course, it depends on jQuery, whereas Fine Uploader does not have any dependencies, according to its Web site.  I just thought it was worth mentioning there's an alternative.

Al


--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hobousers+...@googlegroups.com.
To post to this group, send email to hobo...@googlegroups.com.
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.



--
Finding a solution to a problem requires different thinking from that which created the problem. - paraphrasing Albert Einstein

Stefan Haslinger

unread,
Jan 30, 2014, 11:12:32 AM1/30/14
to hobo...@googlegroups.com
Hi Al! 

Your input is very welcome!
More choice is always good and GPL can be a show stopper, for sure.
I compiled the JQuery version as we have it in Hobo at our fingertips anyway ... 

I actually looked into jQuery File Upload yesterday, the main reason I went away was that I thought it lacked paste support from the clipboard. 
Looked into it again, it is actually mentioned on the Options Page. So it seems to be a full replacement. You are using it?

Ciao,
Stefan


2014-01-30 Albert Chou <hotfus...@gmail.com>:

--
You received this message because you are subscribed to a topic in the Google Groups "Hobo Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hobousers/cjNPcK-auwg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hobousers+...@googlegroups.com.

To post to this group, send email to hobo...@googlegroups.com.
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/groups/opt_out.



--
Mag.Stefan Haslinger
Informatom EDV-Dienstleistungen e.U.
Vorgartenstraße 145/2/3
1020 Wien
FN 357693w
Tel.: +43 680 213 3030
Email: stefan.h...@mittenin.at
WWW: http://informatom.com
WWW: http://mittenin.at

Stefan Haslinger

unread,
Feb 28, 2015, 3:33:51 PM2/28/15
to hobo...@googlegroups.com
Hi Al!

Meanwhile, I prefer Jquery-File-Upload as well. It has lot's of advantages, maybe only advantages ;-)
- controller integration is seemless into Hobo
- form integration is seemless
- multi file upload is seemless (no controller modification needed, several requests are generated by the library automatically)
- copy& paste to the full page is seemless
(- the only thing not working for me is pasting, but that could be caused by my window manager from Ubuntu mate).

So thanks for you pointer!
Ciao,
Stefan
Reply all
Reply to author
Forward
0 new messages