Hello,

I need to import a file from drupal system directory once a day (from private file system).

I've tried to write relative and absolute path in the URL field, but an error 403 is displayed:

Exception: Download of [...]/system/files/filename.xml failed with code 403. en FeedsHTTPFetcherResult->getRaw() (line 52 of [...]/sites/all/modules/contrib/feeds/plugins/FeedsHTTPFetcher.inc)

Is there a way to import files from system directory?

Thanks!!

Comments

dromansab created an issue. See original summary.

dromansab’s picture

I've just seen that if i choose "File upload" instead of "http fetcher" I'am able to upload files from system directory.

megachriz’s picture

Status: Active » Fixed

Yes, the file fetcher has an option called "Supply path to file or directory directly". If enabled, you can import files from a directory on the same server.

The reason why downloading the source fails using the HTTP Fetcher is that by trying to access a file using a URL like http://www.example.com/system/files/filename.xml, Drupal will perform access checks to find out if it may deliver the private file. When importing content using cron, the current active user is anonymous and Drupal is likely to reject a request to a private file in this case. It depends on your configuration and which modules you have installed that act on the private filesystem if the file is delivered or not. Modules can implement hook_file_download() to control access to private files.

Status: Fixed » Closed (fixed)

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