3 <!-- http://rubyforge.org/pipermail/mongrel-users/2007-July/003747.html -->
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
5 <title>streaming upload progress test</title>
6 <%= javascript_include_tag 'ajax_pull/prototype-1_5_1.js' %>
7 <%= javascript_include_tag 'ajax_pull/ajax_pull.js' %>
8 <%= javascript_include_tag 'ajax_pull/upload_progress.js' %>
12 upid = "#{Time.now.to_i}.#{rand}"
13 act = { :action => 'pull', :upload_id => upid }
16 :target => 'upload-target',
17 :onsubmit => "UploadProgress.begin('#{upid}')"
21 <% if flash[:notice] %>
22 <div class="notice"><%= flash[:notice] %></div>
25 This is a demo of <a href="http://upr.bogomips.org/">upr</a> in action
26 with Ajax.Pull. It only uses a single, streaming AJAX request instead
27 of pulling. It is based on <a
28 href="http://rubyforge.org/pipermail/mongrel-users/2007-July/003747.html"
29 >mongrel_<b>streaming</b>_upload_progress</a>
32 This is different from the polling
33 <a href="/">mongrel_upload_progress-compatible</a> version
34 and also different from the polling
35 <a href="/files/new">jQuery+nginx/lighttpd-compatible</a> version
38 <p><%= link_to "#{upid} (single)",
39 :action => 'status', :upload_id => upid %></p>
40 <p><%= link_to "#{upid} (stream)",
41 "/progress?long&upload_id=#{upid}" %></p>
43 <% form_tag(act, opt) do %>
44 <div><p><%= file_field_tag :data %></p></div>
45 <p><%= submit_tag :Upload %></p>
48 <p>Below is the results <code>div</code></p>
49 <div id="results">(nothing)</div>
51 <p>Below is the progress bar <code>div</code></p>
52 <div id="progress-bar"></div>
54 <p>Below is the debug list</p>
57 <iframe id="upload-target" name="upload-target" src="about:blank"></iframe>