Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
filedownload is buggy and I can't figure why
Hopfully someone can help, because I allready spend a couple of hours on it to no avail.
When I create a download link
<txp:file_download_link id="1" >DOWNLOAD</txp:file_download_link>
and open or save the file (tested with different pdf files) I get an error exists on this page. Acrobat may not display this page correctly… when opening with Acrobat reader.
If I link the same file directly (www.mypage/files/download.pdf) the file opens without any problems in the browserwindow or when opened with Acrobat from the server.
I suppose it has to do with the application/octet-stream header. The server is set to bin for this mime type. Is that wrong, what else could cause this behavior?
I tried the same Setup on a different server and all works as supposed.
here is the setup/diagnostic
Textpattern version: 4.4.0 (r3514)
Last Update: 2011-04-12 10:50:53/2011-04-12 10:41:14
Document root: /var/webs/*****************/public_html (/home/*****/public_html)
$path_to_site: /home/*****/public_html/
Textpattern path: /home/***/public_html/ihd/textpattern
Permanent link mode: title_only
open_basedir: .:/usr/local/share/pear:/home/***:/var/webs/************/public_html
upload_tmp_dir: /home/***/.uploads
Temporary directory path: /home/***/public_html/tempo
Site URL: ***********************
PHP version: 5.2.9
GD Image Library: bundled (2.0.34 compatible); supported formats: GIF, JPG, PNG.
Server TZ: Europe/Berlin
Server Local Time: 2011-06-02 22:39:25
DST enabled?: 0
Automatically adjust DST setting?: 0
Time Zone: Europe/Kopenhagen (3600)
MySQL: 5.0.77
Locale: en_GB.UTF-8
Server: Apache
Apache version: Apache
PHP Server API: apache2handler
RFC 2616 headers:
Server OS: FreeBSD 7.1-RELEASE-p3
Active plugins: jmd_html-0.4, hak_article_image-0.6.3, hak_tinymce-1.0, soo_plugin_pref-0.2.2, soo_editarea-0.1.3
Admin-side theme: ant_active 4.4.0
Pre-flight check:
————————————
Textpattern version: 4.4.0 (r3514)
Last Update: 2011-04-12 10:50:53/2011-04-12 10:41:14
Document root:[removed]
$path_to_site: [removed]
Textpattern path: [removed]
Permanent link mode: title_only
open_basedir: .:[removed]
upload_tmp_dir: [removed]
Temporary directory path: [removed]
Site URL: [removed]
PHP version: 5.2.9
GD Image Library: bundled (2.0.34 compatible); supported formats: GIF, JPG, PNG.
Server TZ: Europe/Berlin
Server Local Time: 2011-06-02 22:39:25
DST enabled?: 0
Automatically adjust DST setting?: 0
Time Zone: Europe/Kopenhagen (3600)
MySQL: 5.0.77
Locale: en_GB.UTF-8
Server: Apache
Apache version: Apache
PHP Server API: apache2handler
RFC 2616 headers:
Server OS: FreeBSD 7.1-RELEASE-p3
Active plugins: jmd_html-0.4, hak_article_image-0.6.3, hak_tinymce-1.0, soo_plugin_pref-0.2.2, soo_editarea-0.1.3
Admin-side theme: ant_active 4.4.0
Pre-flight check:
————————————
Some Textpattern files have been modified:
/textpattern/include/txp_log.php
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: proc_nice, proc_close, proc_get_status, proc_terminate, pclose, posix, pcntl, expect, posix_ctermid, posix_errno, posix_get_last_error, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix_getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_initgroups, posix_isatty, posix_kill, posix_mkfifo, posix_mknod, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_strerror, posix_times, posix_ttyname, posix_uname
The following PHP functions (which may be necessary to run Textpattern) are disabled on your server: proc_nice, proc_close, proc_get_status, proc_terminate, pclose, posix, pcntl, expect, posix_ctermid, posix_errno, posix_get_last_error, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix_getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_initgroups, posix_isatty, posix_kill, posix_mkfifo, posix_mknod, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_strerror, posix_times, posix_ttyname, posix_uname
bc..
Last edited by [Axel] (2011-06-02 21:00:16)
Greetz [Axel]
Offline
Re: filedownload is buggy and I can't figure why
Please don’t censor your diagnostics and provide an example URL that demonstrates the problem.
Offline
Re: filedownload is buggy and I can't figure why
sorry, but the site is on a client server, and I cant at this time provide any links.
It is the same problem as described here
Greetz [Axel]
Offline
Re: filedownload is buggy and I can't figure why
Does the problem occur in multiple browsers?
Can you send me a link by email if you don’t want it published here on the forum?
What I’d like to do is check the differences between the two download links in the file that is downloaded.
Offline
Re: filedownload is buggy and I can't figure why
sure if you give me your mail
Greetz [Axel]
Offline
Re: filedownload is buggy and I can't figure why
Look at the left side of my posts. There should be an email link there.
Offline
Re: filedownload is buggy and I can't figure why
Here’s what I see (without revealing site specific details):
Direct download: 1741936 bytes
Through TXP: 1741508 bytes
Somehow 428 bytes get lost in the download. The interesting part is which bytes get lost:
--- hex.file 2011-06-04 06:10:22.000000000 +0000
+++ hex.txp 2011-06-04 06:10:49.000000000 +0000
@@ -4543,7 +4543,6 @@
99
92
d4
-2f
3e
3d
ef
@@ -30209,7 +30208,6 @@
22
2f
22
-2f
3e
0a
20
@@ -30444,7 +30442,6 @@
22
2f
22
-2f
3e
0a
20
...
And this list continues on and one. What I did is create a hex dump of the file, one byte on each line. So There are bytes missing at position 4543, 30209, 30444, 30679 etc.
The missing “2f” characters are really slashes “/”. At the end of the file, some extra spaces (around 16) are inserted in two seemingly random places.
This is really strange. Does anyone have an idea what might be causing such behaviour?
If not, we’d have to do some debugging on the server itself to find out if the problem is PHP related or caused by the webserver.
Hexdump created like this:
hexdump -C file.pdf |cut -d' ' -f3-10,12-19|tr ' ' "\n" > hex.file
Then I simply used ‘diff -u’ on two such hexdumps (one downloaded directly, one through TXP).
Offline
Re: filedownload is buggy and I can't figure why
thats exactly the same as I figured too.
Found the troublemaker is the jmd_html-0.4 plugin, filtering exactly those slashes. Funny enough I have overseen that the plugin was disabled on the other server where things worked fine.
Thanx for your help ruud
Sunny greetz
[Axel]
Greetz [Axel]
Offline