What is the easiest way to get the built-in progress bar with Ruby / Sinatra / Haml / Passenger / nginx?

I have a website on which users can upload 30 + mb of data in one block, and I want to show them the progress of their download, without causing the web page to stop responding, similar to how the flash works Download to gmail.

Here this question is here , but I donโ€™t know if this progress indicator on the page is on or if it uses the browser progress indicator. I am also a little web newbie, so I'm not sure if this is the โ€œeasiestโ€ one. I asked swfupload guys how to do it here , and I got the answer: โ€œthis tool requires some knowledge to use itโ€, without giving me a lot of help in determining where to start. I also asked this question on ServerFault and did not get an answer, so maybe this was the wrong place to ask.

I am all involved in learning new things, etc., but there are many potential ways. Where to start, and what do I need to know for everything to work with sinatra, haml, ruby, passenger and nginx?

Thank!

+3
source share
2 answers

Flash is probably the simplest solution, but it is also the ugliest: as some people on the SWFUpload forum said, Flash support on Linux seems to be crap, and in the end, if possible, you should avoid using it.

So, the following solution uses a combination of server modules + Javascript on the client.

Note I have already partially answered your ServerFault question .

For simplicity, I suggest you upgrade to Apache or Lighttpd.

( apache/lighttpd mod_uploadprogress) API, Javascript, .

2 ( File Uploader, , ):

  • AJAX (. )

  • , , AJAX " IFrame": Javascript- ( ), IFrame IFrame. , Javascript " " .

Javascript , ( ). - . jqueryUI.

, , Ruby/Sinatra/Haml//Apache.

,

+4

AFAIK, html/javascript. Flash Java - . Swfupload - , ( , ), .

0

Source: https://habr.com/ru/post/1738067/


All Articles