Hey,

I ran into a strange problem today and need help...

I added cake's media view as download action to my app, which works
fine when I download files from my virtual hosts on my dev laptop. The
files are being downloaded from a central fileserver, and all files
are downloaded complete and working from there.

The interesting part is when I try to download the files via my
production server where the app is running, I get 0 byte files! How
can this be?
The folder and files can be accessed by the webserver (I also tried
777 on the files...) and as I said everything works fine from my local
dev machine.

Here's the code by the way:

function download($filename = null) {
        $file = $this->Upload->findByFilename($filename);
        if(empty($file)) {
            $this->Session->setFlash(__('Sorry, could not find
requested file!', true), 'default', array('class' => 'negative'));
            $this->redirect($this->referer());
        }
        $this->view = 'media';
        $params = array(
              'id' => $file['Upload']['filename'],
              'name' => $file['Upload']['original_name'],
              'download' => true,
              'extension' => 'pdf',
              'path' => 'http://my.fileserver.com/pdf/'
        );
        $this->set($params);
}

Could this be an apache problem or something with the mimetype? I just
do not understand why I can download the files from my local computer
when the app runs under XAMPP, but not from the production server...?
If there is an access restriction, why can I get the files from here
but not from a real server?!

Please help...

Regards,

DD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to