Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-12-20 11:02:59

NathanLogan
Member
From: Idaho
Registered: 2004-10-05
Posts: 24
Website

Getting file_download not found message, suspect .htaccess problem

Am hoping for some of your expert advice here.

I am in the process of implementing file downloads for a couple categories on a site. After running into several problems (file size limitations, trying to upgrade to TxP 4.0.7, then having to revert, etc.), I got it running as expected, except that when a URL is clicked, TxP can’t locate it (I’ve tried files of different type, size, etc.). Intriguingly, when I tried to upgrade to 4.0.7, it told me that the clean URL check failed, but my implementations of clean URLs seemed to remain functioning (e.g. http://siteurl.com/section/category/ loaded properly). I am also running zem_rewrite 0.6. Anyway, here’s a quick run-through of the exact problem:

For an uploaded file named something like “graphic.png”, I get a URL something like this:

http://siteurl.com/file_download/4

When that link is clicked, I get a TxP-generated page (not a 404) that says this:

“The page you requested, file_download/4, was not found.”

Any ideas? Troubleshooting helps are below…

The pertinent part of my article form:

<ul> <txp:file_download_list limit="99" break="li" sort="filename desc" form="files_sidebar" category="children" /> </ul>

My file form (“files_sidebar”, as referenced above):

<li><txp:file_download_link> <txp:file_download_description /> </txp:file_download_link></li>

And my diagnostics info:

Textpattern version: 4.0.3 (r1188)
Last Update: 2008-12-20 10:34:36/2008-12-20 10:32:58
Document root: /[redacted] (/[redacted])
$path_to_site: /[redacted]
Textpattern path: /[redacted]/textpattern
Permanent link mode: section_title
Temporary directory path: /[redacted]/textpattern/tmp
Site URL: [redacted]
PHP version: 5.2.6
Server Local Time: 2008-12-20 02:44:02
MySQL: 5.0.67-log
Locale: en_US.UTF-8
Server: Apache/2.0.61 (Unix) PHP/4.4.7 mod_ssl/2.0.61 OpenSSL/0.9.7e mod_fastcgi/2.4.2 DAV/2 SVN/1.4.2
PHP Server API: cgi-fcgi
Server OS: Linux 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194

.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/

<IfModule mod_rewrite.c> RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L] RewriteRule (.*) index.php </IfModule>

#php_value register_globals 0

————————————

Offline

#2 2009-05-19 03:32:01

fbox
Member
From: Melbourne
Registered: 2006-02-18
Posts: 42

Re: Getting file_download not found message, suspect .htaccess problem

Hi Nathan and others. I’ve also experienced this issue and would be keen to know about why it happens. Any updates or new info since you posted 6 months ago?

Offline

#3 2009-05-19 22:17:40

NathanLogan
Member
From: Idaho
Registered: 2004-10-05
Posts: 24
Website

Re: Getting file_download not found message, suspect .htaccess problem

In never receiving a reply and being more-or-less lost on this one, I had to do a bit of hackyness to get this to work. Rather than use the built-in <txp:file_download_link> (which does some nice things, including obscuring your files directory), I was forced into linking directly to the file. My solution follows (it may vary from yours in some places due to specifics of my setup, but the logic/code is all there).

“Page” template code:

<txp:article_custom category="foo" form="static_withSubcolumns_foo" />

static_withSubcolumns_foo (Forms / type:article):

<ul> <txp:file_download_list break="li" sort="description desc" form="files_sidebar" category="foo" /> </ul>

files_sidebar (Forms / type:file):

<li><a href="/files/<txp:file_download_name />"><txp:file_download_description /></a></li>

So yeah, that last one is the important one – I just directly specify the download folder. Less secure, arguably – but then again, not much of a risk.

I hope that helps. Good luck to ya’.

Offline

Board footer

Powered by FluxBB