rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - waskol

Pages: 1
1
Bug reports / Re: File Listing
« on: October 27, 2009, 10:02:28 AM »
Yes, I confirm, you have to add a blank line  ;)

Code: [Select]
%files%
[files]
%folder%
%number-folders%
%number-files%
%list%
[file]
%item-name%

[folder]
%item-name%/

(note the two blank lines)

Attached is the tpl file I use

Note : this tpl file permits a distant webserver to "ask" for a Directory listing (from a php code for instance) :
Code: [Select]
<?php
$httpServer 
"http://WWW.XXX.YYY.ZZZ/RootFolder/"//HFS server address + root folder to "view"
$dir_icon='<img style="border: none;vertical-align: middle;" src="'.CHEMIN.'inc/img/general/dir.gif" alt=" " />';
$up_icon='<img style="border: none;vertical-align: middle;" src="./img/top.gif" alt=" " />';
$file_icons='<img style="border: none;vertical-align: middle;" src="./img/{FileType}.gif" alt=" " />';
$excel_img="excel";
$word_img="word";
$zip_img="zip";
$pdf_img="acrobat";
$txt_img="text";
$uknw_im="unknown";
set_time_limit(160);

function 
MessageErreur($message){
    echo 
"Error, blabla, Thank you !";
}

$workingDir $httpServer;
$dossier_agent='';
$path="./";
if (isset(
$_GET['to']) && $_GET['to'] != '') {
$AFolder=stripslashes(urldecode($_GET['to'])); 
$path=$workingDir.rawurlencode($_GET['to']).'/';
echo "<b>Dossier de : </b>".ucwords(strtolower($AFolder)).'<hr />';  
$lines=array();
$lines=file($path.'~files.lst');            
$cfolder=$lines[0];
$n_folders=$lines[1];
$n_files=$lines[2];
$flist=array();
if($n_files!=0) {
$flist=array_slice($lines3+$n_folders);
sort($flist);
foreach($flist as $fname){   
$ext substr($fnamestrrpos($fname'.') + 1);
if ($ext=="xls"){$FileType="excel";}
elseif ($ext=="doc"){$FileType="word";}
elseif ($ext=="zip"){$FileType="zip";}
elseif ($ext=="pdf"){$FileType="acrobat";}
elseif ($ext=="txt"){$FileType="text";}
else{$FileType="unknown";}
$in = array ('{FileType}');
$out = array ($FileType);
$img str_replace ($in$out$file_icons);
echo '<a href="'.$httpServer.$AFolder.'/'.basename($fname).'" target="_blank">'.$img.' '.ucwords(strtolower(basename($fname))).'</a><br />';
}
}
else {
echo "Folder empty !";
}
echo '<br /><center><div style="text-align: center;"><button onclick="self.location.href=\'javascript:history.go(-1)\'" type="button">Back to folder list</button></div></center>';

}
else {
echo "<b>List of folders :</b><hr />\n";
$nav="";
for ($i="A"$i != "AA"$i++){
$nav.='  <a href="#letter'.$i.'">'.$i.'</a>&nbsp;'."\n";
}
echo $nav.'<br />';                           
$oldfirst=" ";
$lines=file($workingDir.'~files.lst');
$cfolder=$lines[0];
$n_folders=$lines[1];
$n_files=$lines[2];
$flist=array();
if($n_folders!=0){
$flist=array_slice($lines3$n_folders);
for($i=0;$i<$n_folders;$i++){
$s=trim($flist[$i]);
$flist[$i]=substr($s,0,-1);
}

foreach($flist as $fname){
//$fname=substr(
$first $fname[0];
/* Alpha Separator */
if($first!=$oldfirst){
echo '<br /><b><span style="width: 100%; font-size: 18px;">';
echo '<a name="letter'.$first.'" href="#top" title="Back to Top of page">'.$up_icon.'</a>'.$first;
echo '</span></b><hr width="100" />'."\n";
}
$oldfirst=$first;
echo '<a href="pcu.php?to='.urlencode($fname).'">'.$dir_icon.' '.ucwords(strtolower($fname)).'</a><br />'."\n";
}
}
else {
echo "Empty Folder !";
}
}

?>

2
It works perfect !
Thank you rejetto !

(Just had to add a blank line in my filelist.tpl file, according to this post : File Listing )

3
Thank you !
I will be able to test it on Tuesday.
I keep you informed  :)

4
Hello, here is a bug I meet with HFS. I think it is a timeout problem.

At our office, we share some files on our intranet with the help of hfs. Among those filesthere are some .doc and .xls
When a ms office file (word, excel) is opened from IE, IE hangs 3-4 minutes before displaying the document.


Software invoved :
- XP sp1
- IE6
- Office 2000
- HFS 2.2f
- The opening of excel or word documents should be allowed from Internet explorer.

Sorry, but I cannot get a workaround for this, since at my office I am obliged to use what was installed on my PC : I do not have the administrative permissions to update anything, nor change some settings (registry and HDD are read only, that hmmm... >:( )
Of course, we have firefox installed, wich does not have this problem, but here, there are about 500 people and amongg them, some only know Internet explorer... ;D

Steps to reproduce :
browse to a word or Excel file from IE, click on the link,
The first time, a dialog appears and you can select Open/Save/Cancel/information,choosing "Open" then opens the document in excel or word : no problem.

Now, the file is in the cache of the browser, right ?
Close excel, click a 2nd time on the link : IE tries to open the document from within its window (OLE), but then it takes ages in order to load the document.

Let's compare HFS log with quick'n easy web server
- HFS Log :
Quote
1st download attempt
14:01:46 172.22.16.185:3977 Connected
14:01:46 172.22.16.185:3977 Got 313 bytes
14:01:46 172.22.16.185:3977 Requested GET /TEST INTRANET/PMU/Equipe1.xls
14:01:46 172.22.16.185:3977 Request dump
> GET /TEST%20INTRANET/PMU/Equipe1.xls HTTP/1.1
> Accept: */*
> Referer: http://www.crna-o.aviation/e/in/articles.php?lng=fr&pg=146
> Accept-Language: fr
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727)
> Host: 172.22.16.185
> Connection: Keep-Alive
14:01:46 172.22.16.185:3977 Sent 1460 bytes
14:01:46 172.22.16.185:3977 Fully downloaded - 22,50 KB @ 1536 KB/s - /TEST INTRANET/PMU/Equipe1.xls
...1s download was OK
2nd download attempt :
14:01:53 172.22.16.185:3977 Got 363 bytes
14:01:53 172.22.16.185:3977 Requested GET /TEST INTRANET/PMU/Equipe1.xls
14:01:53 172.22.16.185:3977 Request dump
> GET /TEST%20INTRANET/PMU/Equipe1.xls HTTP/1.1
> Accept: */*
> Referer: http://www.crna-o.aviation/e/in/articles.php?lng=fr&pg=146
> Accept-Language: fr
> Accept-Encoding: gzip, deflate
> If-Modified-Since: Thu, 22 Oct 2009 13:33:57 GMT
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727)
> Host: 172.22.16.185
> Connection: Keep-Alive
14:01:53 172.22.16.185:3977 Not modified, use cache <-- Tells to IE to use it's cache
14:01:53 172.22.16.185:3977 Disconnected by server - 23040 bytes sent
14:01:53 172.22.16.185:3982 Connected
14:01:53 172.22.16.185:3982 Got 183 bytes <-- Long wait starts here, HSF displays "Requesting"
14:02:54 172.22.16.185:3982 Disconnected by server: inactivity
14:02:54 172.22.16.185:3986 Connected
14:02:54 172.22.16.185:3986 Got 266 bytes
14:02:54 172.22.16.185:3986 Requested GET /_vti_inf.html <-- Webdav thing of excel
14:02:54 172.22.16.185:3986 Request dump
> GET /_vti_inf.html HTTP/1.1
> Date: Fri, 23 Oct 2009 12:02:54 GMT
> MIME-Version: 1.0
> Accept: */*
> User-Agent: Mozilla/2.0 (compatible; MS FrontPage 4.0)
> Host: 172.22.16.185
> Accept: auth/sicily
> Content-Length: 0
> Connection: Keep-Alive
> Cache-Control: no-cache
14:02:54 172.22.16.185:3986 Sent 1460 bytes
14:02:54 172.22.16.185:3986 Not served: 404 - Not found
14:02:54 172.22.16.185:3987 Connected
14:02:54 172.22.16.185:3987 Got 391 bytes
14:02:54 172.22.16.185:3986 Disconnected by server - 1857 bytes sent
14:03:54 172.22.16.185:3987 Disconnected by server: inactivity
14:03:54 172.22.16.185:3988 Connected
14:03:54 172.22.16.185:3988 Got 223 bytes
14:04:54 172.22.16.185:3988 Disconnected by server: inactivity <--finally document is displaying


I've tried with another web server (Quick'n easy web server) in order to compare, and in fact, the client is disconnected ASAP after a 304 or a 404 response....
Quote
13:33:39.609  [612] Client connected from 127.0.0.1
13:33:39.609  [612] Processing HTTP request for domain: 'localhost:8000'...
13:33:39.609  [612] Sending file: D:\testweb\equipe1.xls
13:33:39.609  [612] Response: 304 Not Modified
13:33:39.609  [612] Transfer complete
13:33:39.609  [612] Client disconnected from 127.0.0.1
13:33:39.687  [1064] Client connected from 127.0.0.1
13:33:39.687  [1064] Processing HTTP request for domain: 'localhost:8000'...
13:33:39.687  [1064] Sending file: D:\testweb\index.html
13:33:39.687  [1064] Response: 200 OK
13:33:39.687  [1064] Transfer complete
13:33:39.687  [1064] Client disconnected from 127.0.0.1
13:33:39.687  [4000] Client connected from 127.0.0.1
13:33:39.687  [4000] Processing HTTP request for domain: 'localhost:8000'...
13:33:39.687  [4000] Error processing: /_vti_inf.html
13:33:39.687  [4000] Response: 404 Not Found
13:33:39.687  [4000] Client disconnected from 127.0.0.1
13:33:39.703  [2060] Client connected from 127.0.0.1
13:33:39.703  [2060] Processing HTTP request for domain: 'localhost:8000'...
13:33:39.703  [2060] Error processing: /_vti_bin/shtml.exe/_vti_rpc
13:33:39.703  [2060] Response: 404 Not Found
13:33:39.703  [2060] Client disconnected from 127.0.0.1
13:33:39.703  [3184] Client connected from 127.0.0.1
13:33:39.703  [3184] Processing HTTP request for domain: 'localhost:8000'...
13:33:39.703  [3184] Sending file: D:\testweb\equipe1.xls
13:33:39.703  [3184] Response: 200 OK
13:33:39.718  [3184] Transfer complete
13:33:39.718  [3184] Client disconnected from 127.0.0.1

Thus, I set up the "Connection inactivity Timeout" to 1 second (instead of the 60 seconds) and that drastically solved (but partially) the problem (it takes only 3 seconds to open a document now !).

Other else, I wanted to thank you very very much for this wonderfull http file server ! I even managed to get directory listings and download from a distant webserver in php : I will post something about it soon.

Thank you, keep up the good work !

Pages: 1