Re: Upload progress form not redirecting when finished

Joshua Paul
2005-12-14T02:17:33Z

When and where does num_saved get updated/changed?

On Dec 13, 2005, at 5:11 PM, Carl Youngblood wrote:

> Hello, I have an upload action in one of my controllers that looks
> like this:
>
> upload_status_for :upload
> def upload
>     if @request.post?
>         # do some stuff
>         upload_progress.message = "Processing uploaded files..."
>         session.update
>         # do some more stuff
>         upload_progress.message = "#{num_saved} resume(s)
> processed..."
>         session.update
>         # do some more stuff
>         upload_progress.message = "#{num_saved} resume(s) uploaded
> successfully"
>         finish_upload_status = "#{num_saved} resume(s) uploaded
> successfully"
>         session.update
>         if num_saved > 0
>             redirect_to :action => :index
>         end
>     end
> end
>
> The operation finishes successfully, but the user never gets
> redirected to the index action.  Just in case it''s important, here
is
> the relevant section of the view code:
>
> <%= form_tag_with_upload_progress({:action =>
''upload''},
>         {:finish => ''uploadstatus.innerHTML = "Document
> Uploaded"''}) %>
>
> <%= file_field_tag ''zipfile'', {:size => 30} %>
>
> <%= submit_tag(''Upload resumes'') %>
>
> <%= upload_status_tag %>
> <%= end_form_tag %>
>
> Is there something wrong with my code?
>
> Thanks,
>
> Carl
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>