When I link directly to an uploaded file in a Zend Framework based project I get differing results depending on if I'm working in my local environment or my remote environment.
In both cases I want to link to an uploaded photo. The generated URL looks like:
http://whateverserverweareon/projectfiles/project18/photos/aphoto.jpg
On my local machine clicking that link will show me the photo, in my remote machine it gives me a warning about "invalid controller..." (as, while I do not have a "projectfiles" controller, the uploaded photos are in the projectfiles directory on the path specified in that sample url).
So how do I link to these uploaded photos? Create a controller just so I can link to them? Can I bypass the controller altogether and link directly? Is there some sort of custom route I need to create? Should I be doing this in a completely different manner? Any suggestions?
The exception means that on remote mashine your file does not exists in specified location. Standard rewrite rules in .htaccess file is written so that if your file exists (i.e. /projectfiles/project18/photos/aphoto.jpg) then index.php file of ZF will not be executed. You should check that your file exists.
ischenkodv is right. And also, it's a better practice to put your file somewhere out of index.php's directory tree. Perhaps another subdomain.