Enclosure URL path not working for private files?

mikewren - October 31, 2008 - 18:07
Project:FileField Podcaster
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:mfer
Status:active
Description

I'm new to Drupal, and the regular newbie baggage applies... I'm a geek, but have only played with Drupal for a few weeks, please pardon my probably incorrect use of terms, etc.

I cannot force FileField Podcaster to recognize private files path (/system/files/) for the ENCLOSURE link; It seems to default to the system path, in my case: http://mikewren.com/sites/default/files/podcast/newbienet2008-05-18_0.mp3

I tried making files public, to no avail. I tried adding the following to settings.php without success:

$conf = array(
  'swftools_media_url' => 'http://mikewren.com/system/files/podcast', // No trailing slashes!
);

Also, the 1pixel player can't seem to see the local media files either, I'm not sure if it's related to the path issue also.

Here's an example URL: http://mikewren.com/node/97

With so many modules having dependancies, it's hard to track down where the issue is occurring, in FFPC, Views, Content Type, etc.

I'm out of ideas, and not sure how to proceed in my troubleshooting. Thanks for your efforts, I feel like I'm so close to the endzone here...

#1

grendzy - October 31, 2008 - 22:30
Status:active» needs review

It's necessary to call file_create_url() in order to support sites with private filesystems.

A patch is attached.

AttachmentSize
ffpc_private_files.patch.txt 1.24 KB

#2

mikewren - November 2, 2008 - 15:41
Status:needs review» reviewed & tested by the community

Fantastic, thank you so much! Swapped out those two lines and the Feed now lists the private filesystem URL as expected. I Hope these changes make it into the official release.

#3

mfer - December 16, 2008 - 01:43
Assigned to:Anonymous» mfer

This is on my plate to handle. I'm looking at fixing an issue with the guid for those coming from the audio module.

#4

mfer - December 30, 2008 - 21:41

This has been committed to head. Please test and let me know if there are any issues.

#5

mfer - December 30, 2008 - 21:41
Status:reviewed & tested by the community» fixed

#6

System Message - January 13, 2009 - 21:50
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#7

mattman - June 24, 2009 - 07:56
Status:closed» active

You also need to adjust the url for the enclosure tag as well.

starting at about line 85 in HEAD

Currently...

        $file_extra[] = array(
          'key' => 'enclosure',
          'attributes'  =>  array(
            'url'   => url( $file['filepath'], array('absolute'=>TRUE) ),
            'length'  => $file['filesize'],
            'type'    => $file['filemime'],
          ),
        );

should be...

        $file_extra[] = array(
          'key' => 'enclosure',
          'attributes'  =>  array(
            'url'   => file_create_url($file['filepath']),
            'length'  => $file['filesize'],
            'type'    => $file['filemime'],
          ),
        );

Enclosures offer the raw url when file system is set to private.

This will bypass any modules which use hook_file_download().

If the web server has been set to restrict access (which mine has) to the /files folder directly, then no files are transferred because of the bypass of file.inc's creation of the correct file url path.

 
 

Drupal is a registered trademark of Dries Buytaert.