Skip to main content
GGOCJ
Participant
April 11, 2025
Question

PDF file name changes when downloading

  • April 11, 2025
  • 3 replies
  • 1862 views

When in Chrome, the PDF file name downloads as gibberish.  If I use Firefox, Brave or edge, the file name downloads as intended.  I thought it might have been a Chromium thing, but Brave runs on Chromium, as well.

Any thoughts?

I post to a site where my PDFs are downloaded daily... and since most of internet users have Chrome as their default browser, unless on MAC, they are experiencing this problem.

i.e. https://www.cookcountycourt.org/division/county-division/adoption-cases

PDFs can be found scattered around that page.

3 replies

try67
Community Expert
Community Expert
April 11, 2025

I tried 5 links and none of them were to a PDF file... A more exact description of where to find them would be helpful.

GGOCJ
GGOCJAuthor
Participant
April 14, 2025

Also, the we are using Drupal for the website..

AnandSri
Community Manager
Community Manager
April 21, 2025

Hello!

 

I hope you are doing well.

 

Adding to the suggestions already shared above by our Community product experts and Adobe employees. This seems to be an issue specific to Chrome, and it's related to how the browser interprets file names when the Content-Disposition or Content-Type Headers are not set or encoded properly by the server. 

Why It Happens in Chrome (but not Firefox, Edge, Brave): Chrome is more strict with filename encoding and may mishandle characters if the server doesn't specify them in a way Chrome expects (especially with non-ASCII characters or spaces). Brave, while Chromium-based, sometimes handles downloads differently due to privacy features. Firefox and Edge are more forgiving and apply their own logic to fix these discrepancies.

 

Since the site is running Drupal, here’s how you (or your web team) can try to resolve this using these workarounds: 

Set Proper Content-Disposition Headers: Ensure the server sets this header when serving PDFs: Content-Disposition: attachment; filename="GAL_Guide.pdf"

Avoid Double URL Encoding: Drupal sometimes encodes file names multiple times. Or apply a hook to clean the filename output: 

 

function mymodule_file_download($uri) {
  $filename = basename($uri);
  return [
    'Content-Type' => 'application/pdf',
    'Content-Disposition' => 'attachment; filename="' . rawurldecode($filename) . '"'
  ];
}

 

Use Clean, ASCII-Compatible Filenames: When possible, remove characters like brackets [ ], % symbols, or encoded underscores from uploaded file names.

 

Workaround for Users: Until the server-side fix is in place, Chrome users can: Right-click the PDF link and choose "Save link as...", which often corrects the filename. Or use Firefox/Edge if they need more consistent naming for now.

 

As suggested earlier, you should contact the Chrome support team and see if they can assist you with this. 

Note: The steps above are suggestions and workarounds; you may need to modify the code or customize the steps according to your requirements and the machine environment.

 

I hope this helps.

Thanks,

Anand Sri.

GGOCJ
GGOCJAuthor
Participant
April 11, 2025

Good Afternoon, Tariq -

I figured it was something on Google's end, if it wasn't happening in other browsers.
I highly doubt this is something they will bother with.
Your input is much appreciated.

 

[Private info and signtuare removed]

Community Manager
April 11, 2025

Hi @GGOCJ

 

Thanks for reaching out.

 

Unless you are using the Acrobat Chrome extension, which I believe is not considering your users are also experiencing the same issue. 

You need to contact the Google Chrome Support team. 

 

Please feel free to reach out if you have further questions. 


~Tariq