Cameron Yule

Rails 2.1 YUI Uploader Example

I’ve finally committed my Rails 2.1 YUI Uploader example, which is a fully-functioning Rails 2.1.2 application demonstrating the use of YUI Uploader, attachment_fu, CSRF protection and the Restful Authentication plugin. It’s using the latest 2.6.0 release of YUI, which includes the fixes to the the Uploader for Flash Player 10.

It’s up on Github now, all the details you’ll need are in the README.

Published on October 30, 2008 in Programming
Tags: , , , ,

Comments

Join the discussion by leaving a comment, or trackback from your own site. (Comment feed)

Luke Francl
30/10/2008

Ah, very cool! We are using YUI Flash uploader for Tumblon (http://tumblon.com) but I need to upgrade it to the new version so we don’t get left behind when Flash 10 ships. I will take a look at your code.

Cameron
31/10/2008

I much prefer the YUI Uploader to SWFUpload, it just feels more solid.

Hope the example helps!

Bill Eisenhauer
01/11/2008

Bless you for putting this together. One small request to improve this: could you itemize anything special that you had to do to get this to work? I tinkered with the uploader a week ago and had troubles getting the session hack to work in my stuff — looks like you’ve solved it here. But is there anything else we should be looking for that would help smooth a similar implementation?

Bill

Luke Francl
04/11/2008

Yes, the YUI documentation in general is excellent. I like working with their tools. We’re also using the YUI Rich Text Editor.

Cameron
04/11/2008

Hi Bill, good to hear people are finding it useful.

Nothing particularly special, I guess the parts to pay close attention to are the session hack initializer, the assets controller where we disable cookie-only sessions for the create action, the new asset view and the upload() method in uploader.js, which appends the session & CSRF authentication data to the URL we call to do our upload.

Hopefully you’ll be able to get it to work for you, let me know if you have any trouble.

Leave a comment

Comments are moderated, so be nice!