From d7451970e8fcc49fdcc121cf812acc5fc816944c Mon Sep 17 00:00:00 2001 From: Espen Antonsen Date: Mon, 25 Apr 2011 13:54:08 +0800 Subject: [PATCH] fix flash upload. need to send session var as form param --- app/views/photos/upload.html.erb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/photos/upload.html.erb b/app/views/photos/upload.html.erb index 512b7df..1f2291a 100644 --- a/app/views/photos/upload.html.erb +++ b/app/views/photos/upload.html.erb @@ -1,4 +1,4 @@ -<% content_for :javascript do %> +<%= content_for :javascript do %> <%= javascript_include_tag "plupload/js/plupload.full.min.js" -%> <%= javascript_include_tag "plupload/js/jquery.plupload.queue.min.js" -%> @@ -11,10 +11,9 @@ $(document).ready(function() { runtimes : 'html5,browserplus,flash,silverlight,gears', url : '<%= photos_path %>', max_file_size : '10mb', - chunk_size : '1mb', - unique_names : true, multipart: true, multipart_params: { + '<%= get_session_key %>' : encodeURIComponent('<%= u cookies[get_session_key] %>'), 'authenticity_token' : '<%= form_authenticity_token %>', 'photo[album_id]' : "<%= @album.id %>" }, @@ -51,7 +50,6 @@ $(document).ready(function() { // Client side form validation $('form').submit(function(e) { - console.log('hello test'); var uploader = $('#uploader').pluploadQueue(); // Validate number of uploaded files