When adding a token as the first parameter in the File Alias settings I get the drupal "page not found" error when attempting to serve that file at the URL alias, although it does display the file when viewing the file at sites/default/files/[alias-path]

Example:
When adding this to the File Alias settings pdf-files/[node:field-category:url:relative]/[file:ffp-name-only-original].[file:ffp-extension-original] I am able to view files that were added to the following file path pdf-files/[node:field-category:url:relative]. However when attempting this [node:field-category:url:relative]/[file:ffp-name-only-original].[file:ffp-extension-original] to access the files inside this file path [node:field-category:url:relative] I get a drupal "page not found" error although I am certain the file exists since when accessing the file with the full url structure it works sites/default/files/[alias-path]

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hershy.k created an issue. See original summary.

Deciphered’s picture

Priority: Critical » Normal
Status: Needs work » Active

I ran a quick test using [node:nid]/[node:title].[file:ffp-extension-original] as my alias path, and it worked as expected.

It's possible there is something else in play here. Can you please give me steps on how to reproduce this on a fresh Drupal site, ideally using http://simplytest.me so I can test on the same environment?

Deciphered’s picture

Status: Active » Closed (duplicate)
hershey.k’s picture

@Deciphered I apologize for the delayed response. I have as well found a similar fix that I believe you have implemented in #2620140: File Alias only works when matches exact File Path directory structure which fixed this issue and the others I posted around the same time. Below are the other issues which are related that the patch fixed.

I had created a patch for myself at the time, but it seems like you beat me to it to posting it back on line. I am not too familiar yet on the process of posting patches back on to D.O but attached is the patch I had created. It seems that your patch in #2620140: File Alias only works when matches exact File Path directory structure has more changes and I'm sure there is a good reason for that. I'm just sharing what worked for me! Thanks for your quick responses!