This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Alexander Tretyakov (author)
Mon Sep 07 22:10:03 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Mon Sep 07 08:10:16 -0700 2009 | |
| |
README.markdown | Mon Sep 07 08:35:34 -0700 2009 | |
| |
Rakefile | Mon Sep 07 08:10:16 -0700 2009 | |
| |
app/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
config/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
flash/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
images/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
init.rb | Mon Sep 07 08:10:16 -0700 2009 | |
| |
install.rb | Mon Sep 07 22:10:03 -0700 2009 | |
| |
javascripts/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
lib/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
stylesheets/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
tasks/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
test/ | Mon Sep 07 08:10:16 -0700 2009 | |
| |
uninstall.rb | Mon Sep 07 08:10:16 -0700 2009 |
README.markdownNow you can place swfupload form anywhere on your page. You need provide only url hash, same as for
If you want modify swfupload form template then change
Because flash send file data without correct type, you need set content type yourself using mime-types gem(
SWFUploadFu
This plugin allows you to easily integrate SWFUpload to your Ruby on Rails application
Installation
script/plugin install git://github.com/alex3t/swfupload_fu.git
Using
SWFUpload required some javascripts and stylesheets. For this you can use SWFUploadFu helper in your views
<head>
<title>...</title>
<%=swfupload_head %>
</head>
Now you can place swfupload form anywhere on your page. You need provide only url hash, same as for url_for
<%=swfupload :controller=>'assets',:action=>'upload'%>
If you want modify swfupload form template then change /app/views/shared/_swfupload_form.html.erb. Keep only elements and their IDs.
Attachment_Fu integration
You able access uploaded file from params[:Filedata] in your upload action.
Because flash send file data without correct type, you need set content type yourself using mime-types gem(gem install mime-types). For example:
require 'mime/types'
class Asset < ActiveRecord::Base
has_attachment
def swf_uploaded_data=(data)
data.content_type = MIME::Types.type_for(data.original_filename)
self.uploaded_data = data
end
end
class AssetsController < ApplicationController
def upload
@file = Asset.new :swf_uploaded_data => params[:Filedata]
@file.save
...
end
end







