Page 1 of 2
errors with download/display pdf
Posted: Thu 30. Nov 2006, 22:53
by Balubaer
hi out there, dear community.
i think, i was a little bit too hasty with my reply on seedy's problem with firefox 2.0 and his download problems. (
http://www.phpwcms.de/forum/viewtopic.php?t=13199)
i made some tests and hope that anyone can comprehend these results... and hopefully have a helping suggestion.
i tested my pages with firefox (in version 1.5.x and 2.x) and internet explorer (version 6) and got the following astonishing results:
setting inline_download = 1:
displaying pdf was stopped (message "angehalten") with firefox
displaying pdf in internet explorer worked well
setting inline_download = 0:
downloading pdf in firefox worked well (open with application and saving on hardisk)
downloading pdf in internet explorer only worked with downloading on harddisk, but not "open with application" (error message "file not found")
so now i have the problem that i cannot decide what option to take....
the websites are hostet on apache 1.3.3 (unix) and php 4.4.4. (but i cannot change this.)
can anyone help me please?
thanks in advance,

dennis
Posted: Thu 30. Nov 2006, 23:15
by Oliver Georgi
this is solved in coming release.
Oliver
Posted: Thu 30. Nov 2006, 23:21
by Balubaer
hi oliver,
i know this must be one the annoying questions, but when will the new release be public?
i think there will be many things fixed.
greetz,
dennis
Posted: Thu 30. Nov 2006, 23:40
by Oliver Georgi
no comment - ich denke zeitnah (was auch immer das heißen mag). Nun hat es so lange gedauert, dass ich 1-2 Sachen auf jeden Fall noch integriere...
Oliver
Posted: Thu 30. Nov 2006, 23:48
by Balubaer
hab ich's mir doch gedacht, dass ich dich nicht zu einer wirklichen aussage überreden kann.
dann sei mal schön fleissig...
... to be continued ...
download.php
Posted: Mon 11. Dec 2006, 15:03
by sebby
Any interim solution before the patch is out? The current version is unstable both on IE and FF...
Should we use 'download.php' from previous distro?
Seb
Posted: Mon 11. Dec 2006, 16:43
by Oliver Georgi
yes you can.
Oliver
Posted: Wed 13. Dec 2006, 19:55
by sebby
Hello Oliver,
I tried the file 'download.php' included into last spring's distro (v.1.2.6) and I get the following error message:
error while retrieving file download infos
Any other suggestion?
Seb
Posted: Wed 13. Dec 2006, 21:14
by Oliver Georgi
Posted: Wed 13. Dec 2006, 22:03
by sebby
Hi-
All I get is "
404 File Not Found"
seb
Posted: Wed 13. Dec 2006, 22:29
by Oliver Georgi
Then you might have another problem. Maybe permissions wrong.
Oliver
Posted: Thu 14. Dec 2006, 23:22
by sebby
Hello-
filestorage dir is 777 and all file in it are 644 (nobody:nobody). I tried 777 for all files and directories in filestorage without further success....
Is there anything else I missed ?
Posted: Thu 14. Dec 2006, 23:53
by sebby
After I changed all file permissions to 777 (in filestorage dir) and set the inline_download = 0, the original 'download.php' included in the 1.2.8 distro appear to be working just fine.... I'll run some more tests and I'll keep you guys posted.
Seb
Posted: Fri 15. Dec 2006, 20:26
by sebby
Hello Oliver,
As my tests were not conclusive with v126, I turned back to the 'download.php' v129pre that Oliver provided earlier and I noticed that it had a new way of processing the query string... As I did not install the complete overnight distro (pre129), I uploaded only 'download.php' and edited it as follow:
I commented these two lines:
Code: Select all
$countonly = empty($_GET['countonly']) ? false : true;
$hash = empty($_GET['f']) ? '' : clean_slweg($_GET['f']);
and replaced it with the following:
Code: Select all
if(!empty($_SERVER['QUERY_STRING'])) {
list($hash) = explode('&', $_SERVER['QUERY_STRING']);
$hash = trim(str_replace('=', '', $hash));
if(!empty($_GET['target'])) {
$phpwcms["inline_download"] = 1;
} elseif(isset($_GET['target']) && $_GET['target'] == '0') {
$phpwcms["inline_download"] = 0;
}
}
I seems to be working just fine (w inline download disabled). Again, I'll run some more tests and I'll keep you guys posted.
Thanks for your assistance.
Seb
Posted: Thu 21. Dec 2006, 13:27
by sebby
After much investigation, I found what was compromising the 'download.php'. In the 'dl_file_resume' function ('inc_lib/functions.file.inc.php'), where all the headers are written you will find the following code:
Code: Select all
header("Accept-Ranges: bytes");
$size=filesize($file);
//check if http_range is sent by browser (or download manager)
if(isset($_SERVER['HTTP_RANGE'])) {
list($a, $range)=explode("=",$_SERVER['HTTP_RANGE']);
//if yes, download missing part
str_replace($range, "-", $range);
$size2=$size-1;
$new_length=$size2-$range;
header("HTTP/1.1 206 Partial Content");
header("Content-Length: ".$new_length);
header("Content-Range: bytes $range$size2/$size");
} else {
$size2=$size-1;
header("Content-Range: bytes 0-$size2/$size");
header("Content-Length: ".$size);
}
It appears that the http range thing is causing problems especially with pdfs (moreover, $_server['HTTP_RANGE'] is not configured on my server). So I changed the first line to :
and everything went back to
normal ( distro 1.2.8 ).
Any thoughts on this config?
Seb