rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: r][m on January 07, 2011, 04:05:46 PM

Title: Upload form needs improvement
Post by: r][m on January 07, 2011, 04:05:46 PM
Recently I had a family member try to up load a 600meg
file from a hostel wifi in Europe. He was on a real low
band width connection, and I finally had to call him to
let him know that it was going to take several hours.

We need a way to show the remote user their upload speed
and time left to finish, thats visable to the remote user
on the upload form.
I've tried adding symbols like %speed-in%. Wiki says
it works in all sections, but here it doesn't work anywhere?
Also tried %speed-kb%, %time-left%, %perc% and %speed%
but nothing works. I have the pop up progress window
but it lags behind, and symbols don't work in it either.

I think this would be far more useful than most things
already in the "to do list".

All my effots have failed.
Anyone have a solution that I could add to my template
upload form?
Title: Re: Upload form needs improvement
Post by: Mars on January 07, 2011, 05:19:47 PM
what you are asking work only in the section [progress] and its sub-sections through  var %progress-files%

Quote
inside main.pas

procedure addProgressSymbols();
...
 begin
  if sectionName <> 'progress' then exit;
....
    // apply fields
    files:=files+xtpl(t, [
      '%item-user%', macroQuote(d.usr),
      '%perc%',intToStr( trunc(perc*100) ),
      '%filename%', fn,
      '%filename-js%', jsEncode(fn, '''"'),
      '%done-bytes%', intToStr(bytes),
      '%total-bytes%', intToStr(total),
      '%done%', smartsize(bytes),
      '%total%', smartsize(total),
      '%time-left%', getETA(d),
      '%speed-kb%', floatToStrF(d.averageSpeed/1000, ffFixed, 7,1),
      '%item-ip%', d.address,
      '%item-port%', d.conn.port
    ]);
...
  end; // addProgressSymbols

you can use those variables %xxx% only in this part of the template:
Quote
[progress|no log]
<style>
#progress .fn { font-weight:bold; }
.out_bar { margin-top:0.25em; width:100px; font-size:15px; background:#fff; border:#555 1px solid; margin-right:5px; float:left; }
.in_bar { height:0.5em; background:#47c;  }
</style>
<ul style='padding-left:1.5em;'>
%progress-files%
</ul>

[progress-nofiles]
{.!No file exchange in progress..}

[progress-upload-file]
{.if not|{.{.?only.} = down.}|{:
   <li> Uploading %total% @ %speed-kb% KB/s
   <br /><span class='fn'>%filename%</span>
   <br>
   <div class='out_bar'><div class='in_bar' style="width:%perc%px"></div></div> %perc%%
:}.}

[progress-download-file]
{.if not|{.{.?only.} = up.}|{:
   <li> Downloading %total%
   <br>Speed: %speed-kb% KB/s
   <br /><span class='fn'>%filename%</span>
   <br>
   <div class='out_bar'><div class='in_bar' style="width:%perc%px"></div></div> %perc%%
:}.}
Title: Re: Upload form needs improvement
Post by: r][m on January 08, 2011, 07:10:31 AM
@ Mars
Thanks for your reply.

%speed-kb% in progress window returns 0.0 here on uploads.
Wiki lists %time-left% as related to file transfers? Doesn't work here
in any file transfer sections.

So...your saying there is no way to improve this? Not even with
javascript?  :( 


Title: Re: Upload form needs improvement
Post by: Mars on January 08, 2011, 05:35:17 PM
It would be necessary to verify if the previous template before ajax raises the same problem, I have this small doubt which could be the solution ;)
Title: Re: Upload form needs improvement
Post by: r][m on January 08, 2011, 09:33:28 PM
It would be necessary to verify if the previous template before ajax raises the same problem, I have this small doubt which could be the solution ;)
My template doesn't use AJAX.
I'm not a programer, but I fail to see why it wouldn't be possible to add
this capability to HFS. Without it users trying to upload have no way to
know if theres any reason to wait it out? A half hour to upload is one thing, three
hours is another. Knowing which its going to be is very desirable.
 I was never aware of it before, but I view it as a very serious problem/flaw here.
Title: Re: Upload form needs improvement
Post by: Mars on January 08, 2011, 11:22:40 PM
with the default template of buid 272, replace the section with the same name by this code
Quote
[progress-upload-file]
{.if not|{.{.?only.} = down.}|{:
   <li> Uploading %total% @ %speed-kb% KB/s
   <br /><span class='fn'>%filename%
   <br>done : %done% (%done-bytes%)
   <br>time left :  %time-left%
</span>
   <br>
   <div class='out_bar'><div class='in_bar' style="width:%perc%px"></div></div> %perc%%
:}.}
Title: Re: Upload form needs improvement
Post by: maverick on January 09, 2011, 08:24:09 AM
I agree with r][m there is a symbol problem with build 272 and probably other builds as well.

This is the first time I checked the upload progress for quite some time.  I also wasn't using the latest build before checking this today.  This was all done locally.

Build 240 - no problems
Build 272 - problems - I should also note that every upload I tried to make with this build FAILED.  Log reason was file NOT ALLOWED in Upload folder.  Have no idea why.

I didn't try to determine what build the problem started in.  I just don't have the time right now.  But it is definitely somewhere between build 240 & 272.

I'm attaching a couple of screen shots (one for each build I tried) that clearly show the results.

I use a customized template with absolutely NO javascript or ajax.
Title: Re: Upload form needs improvement
Post by: MarkV on January 09, 2011, 08:54:37 AM
Quote
I should also note that every upload I tried to make with this build FAILED.  Log reason was file NOT ALLOWED in Upload folder.  Have no idea why.

@Maverick: http://www.rejetto.com/forum/index.php/topic,9280.msg1052936.html#msg1052950
Title: Re: Upload form needs improvement
Post by: r][m on January 09, 2011, 10:18:49 AM
Thanks Maverick
%symbols% problem goes back past 253 here. I was going to go back to
240 but it wont run on wine here. I like your progress page, does it close
when the upload finished page appears?

@ Mars
I'd try the progress-upload-file section you posted, with the default tpl, but
the last time I tried the default, it wouldn't work here? Anyway I use my
own tpl, since I don't have time to learn AJAX, and it doesn't look like
the default can be modified very easily.
Title: Re: Upload form needs improvement
Post by: maverick on January 09, 2011, 12:05:48 PM
Thanks Maverick
%symbols% problem goes back past 253 here. I was going to go back to
240 but it wont run on wine here. I like your progress page, does it close
when the upload finished page appears?

Yes.

The only reason why I used build 240 was because it was the oldest build I had available on my drive.


@ MarkV
Thanks.  Looks like this problem was reported on and has been around for a while.  Strange that there wasn't a priority in fixing it.
Title: Re: Upload form needs improvement
Post by: Mars on January 09, 2011, 02:08:46 PM
The build 272 has a known problem concerning access rights with a fatal effect on uploads, it's better to use 271 to test the reproductibvité of the bug of this topic.
 To have a base of common reference, it is necessary to use the template by default extracted of various version and to make tries with the same version of hfs.

The first template with ajax come at build 262
Title: Re: Upload form needs improvement
Post by: r][m on January 09, 2011, 04:35:58 PM
%speed-kb% didn't work here on 240 tpl in progress window.
Progress window lags several seconds behind up load, even at 1 second refresh.
Nothing in Progress Frame works here at all.
Testing locally with latest Firefox, hfs 270A on wine in Ubuntu 10.04

I still think the usable and efficient display of up load speed and time left
need to be improved.
Title: Re: Upload form needs improvement
Post by: Mars on January 09, 2011, 04:53:44 PM
Quote from: r
I still think the usable and efficient display of up load speed and time left
need to be improved.

refer to my post above http://www.rejetto.com/forum/index.php/topic,9361.msg1053058.html#msg1053058
Title: Re: Upload form needs improvement
Post by: r][m on January 09, 2011, 05:54:25 PM
OK
Tried with build 246 and default tpl and inserted progress-upload-file code as posted.
Results were exactly same as 270A test.
Here %speed-kb% and %time-left% don't work.
%filename%, %total%, %done%, %done-bytes% and %perc% work.
Might be hfs.....or may be wine/ubuntu. No way to tell and for
now I can't afford the down time to test further.
Ideally this info should be visible on the upload form/page without
a screen flashing/lag 10 seconds behind, section/frame.
 

Another interesting discovery: I can add users via menu in 246.
In the more recent builds I can't.....thought it was a system problem,
now I know its not.

Title: Re: Upload form needs improvement
Post by: r][m on January 12, 2011, 05:40:20 PM
I tested 240 on win98se with IE6 and like Maverick %speed-kb% works.
%done%, %time-left% and %total% also work.
The [progress-upload-file] window works much better than in recent builds.

Next week as time permits, I'll test this with other builds,
and test on XP Pro.

@ Rejetto
Any help on this topic ?
Title: Re: Upload form needs improvement
Post by: rejetto on January 30, 2011, 01:55:05 PM
i could look into this only now.
i agree that "time left" is a very useful information that needs to be displayed.
i'm adding this line to both upload and download progress-bars

    <br />{.!Time left:.} %time-left%"

the final double quotes sign is to give a clue on the base time unit, that's seconds.
The other information is unnecessary in my opinion, but can be added by diff template redefining the progress section.

I'm testing here with #273 and it is working good.
both the screenshots posted by r][m and maverick where speed is zero also get a speed graph that's showing no network activity was in place. This would point in having no problem in the template itself, but a more general problem with no actvity monitored by the whole HFS or even that there was no data exchanged at that time!
would you please confirm your problem with #273 ensuring there's data actually uploaded in that moment ?

The problem with slow (or no) updates on the browser was improved by the change to the AJAX way. It's a limit of some browsers.
Title: Re: Upload form needs improvement
Post by: rejetto on January 31, 2011, 10:55:30 AM
raybob moved to http://www.rejetto.com/forum/index.php/topic,9407.0.html
Title: Re: Upload form needs improvement
Post by: r][m on February 01, 2011, 07:49:47 AM
Testing 274 on XP Pro Sp2, 1.65 Gb, On LAN, my template, Upload progress window.
%filename%, %total%, %done%, %perc%, %speed-kb%, %time-left%
IE 7 All symbols in Upload Progress Window Work.
Opera 9.80 ver 10.62 All symbols in Upload Progress Window Work
Google Chrome 8.0552.237 All symbols in Upload Progress Window Work
Fire Fox 3.6.13 - %time-left% didn't work, and the progress window
freezes, upload does finish - is repeatable here.

Testing without stunnel. With stunnel, uploads much slower with
some browsers.
Quote
i'm adding this line to both upload and download progress-bars
The problem with slow (or no) updates on the browser was improved by the change
to the AJAX way. It's a limit of some browsers.
Your speaking of the default tpl?
If so, that doesn't help me (and many others I suspect)
I can't use AJAX and it kills some js functions in my web pages.
If the only examples available to implement new things are AJAX in the
default template, thats a progress stopper for me.


Title: Re: Upload form needs improvement
Post by: rejetto on February 28, 2011, 10:18:55 AM
r][m please test this
http://www.rejetto.com/forum/index.php/topic,9407.msg1053524.html#msg1053524