rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: brownfox on March 21, 2009, 01:51:23 AM

Title: Upload interrupts on F5
Post by: brownfox on March 21, 2009, 01:51:23 AM
Uploading a large file (cd image) (IE 6.0) - another window with progress status is open - in the first window pressed the F5 key (refresh) - the upload interrupted, I have to restart it. Is it expected?
Title: Re: Upload interrupts on F5
Post by: MarkV on March 21, 2009, 03:54:57 AM
Yes. It's the browser abondoning the upload. 'Refresh page' in reality means 'Abort any activity and refresh'. That's why there's a seperate status window or a frame.
Title: Re: Upload interrupts on F5
Post by: rejetto on March 25, 2009, 12:07:14 PM
yes, it's expected, but i saw Gmail warning the user before leaving the page, so i searched for the way to do it, and found it.

This code needs to be pasted inside the [upload] section

Code: [Select]
<script>
var fired = 0;
window.onbeforeunload = function () {
if  (document.frm.upbtn.disabled) fired++;
// the first time it is fired, it is the submit itself. following calls are of the user leaving.
if (fired > 1) return 'This upload will be interrupted';
}
</script>


next 2.3 release will include such code
Title: Re: Upload interrupts on F5
Post by: MarkV on March 30, 2009, 10:07:47 PM
Very good, but I guess it will only work if JS is activated...
Title: Re: Upload interrupts on F5
Post by: rejetto on March 31, 2009, 11:08:27 AM
of course.

javascript opens many possibilities, and some features are limited to users with javascript (i guess they are 98%)
Title: Re: Upload interrupts on F5
Post by: MarkV on April 01, 2009, 03:32:07 PM
Nope. Remember Firefox+NoScript - many have it, including me.
Title: Re: Upload interrupts on F5
Post by: rejetto on April 01, 2009, 03:34:55 PM
you mean you think it's far from 98% ?

i would like to see stats!
but that wouldn't change much: no javascript = less features
Title: Re: Upload interrupts on F5
Post by: MarkV on April 02, 2009, 03:10:02 PM
Don't finding any stats. But NoScript is amongst the most popular Firefox addons on the addons page (3rd), many will install it. Adblock Plus and Noscript are today's standards for every Fx install...

Anyway, the OP has IE6 (yuck), JS is enabled on that software.
Title: Re: Upload interrupts on F5
Post by: rejetto on April 03, 2009, 03:42:51 PM
what's OP ?

how do you do with so many websites requiring javascript?

Title: Re: Upload interrupts on F5
Post by: Metaltailz on April 03, 2009, 05:27:10 PM
OP = Original Poster

I have to wonder too, how do you go through the internet with JS disabled?
Title: Re: Upload interrupts on F5
Post by: MarkV on April 06, 2009, 12:29:25 AM
Oh, it works. A good designed website works well without JS, though it may look a bit bland sometimes. Websites that require JS to run are badly designed, never rely on a script language alone.
Of course, if I trust a site, I can enable JS on a per-server base. Example: rejetto.com is allowed and Adblock Plus disabled, so I can give something back to this project. But some sites are like hell without an ad-/scriptblocker.
Title: Re: Upload interrupts on F5
Post by: maverick on April 06, 2009, 01:55:12 AM
I agree 100% with MarkV comments.

I have been active on the net for many, many years browsing almost 100% of the time with JS disabled.  No problems whatsoever.  There are some sites that do require JS to get at some of the content.  No problem - if I want to view it and there is trust in the site, I turn it on temporarily.  Ex. to view videos etc.  My default browser is Opera.

I also use an old program for many years called proxomitron that takes all the crap out of the pages that some sites want you to see.  You wouldn't believe how fast browsing the net can be with that program running in the background.

The bottom line is if you want to use JS, use it.  If you don't want to use it, don't, but don't say you can't travel the internet with JS disabled.   
Title: Re: Upload interrupts on F5
Post by: TSG on April 07, 2009, 06:28:06 PM
Cool script, I'll keep this in mind for my updates and our user content part of the website.

I also have NoScript but I have it disabled (still prevents clickjacking), and I only turn it on if its really necessary. I use Minefield 3.6a1pre at the moment (Firefox testing program). Adblock Plus to remove the garbage.

Javascript is not as scary as a lot of people make it out to be, however designing sites to function only with it is bad usability so I continue to make my sites work mostly without javascript. You'll see evidence of this in the dynamic content of our new website. If no dynamic javascript the site will use php variables on the links (e.g. dynamic news system) there is also other little enhancements like the search field automatically deleting the word Search for you.