0

I'm pretty sure I already know the answer to this, as being able to force the client's computer to open a file with the "Webserver chosen application" would be a huge security risk, but I'm going to ask it anyways.

Can you force an end user's computer to open a file using a certain program? For example, can I use my server to tell a client computer "You need to open *.reg files with Media Player"?

Some background is that we have this website that recently got revamped; it moved from Rails to Drupal, and now the client is saying that when she downloads a .reg file on her website, it tries to open it in Windows Media Player. She says that this didn't happen until we switched websites, so they blame it on the website, but I thought it wasn't possible to set the associated application with the download. I know the file hasn't changed because when I download it and look at it, it indeed is a Registry file.

Goldentoa11
  • 1,700
  • 2
  • 17
  • 29
  • Nope. And hold up... you want your users to download _registry_ files?? – jszobody Jan 16 '14 at 13:37
  • lol, I understand your concerns. It's a website that has an internal section (maybe not the most secure), and the *.reg files are for the employees at the site when they're installing a custom built piece of software. I wasn't there when it was initially set up, so I don't know why they need a *.reg file downloaded and launched, but I have to make sure it keeps working. – Goldentoa11 Jan 16 '14 at 13:50

1 Answers1

0

You can set the content-type, which will hint to the browser how to handle the attached file. This is probably the change causing her problem, I wouldn't be surprised if Drupal is sending your file with some kind of media mime type, when it should probably be text/plain.

I haven't used it but the File MIME module may help you resolve this. I would install this and force .reg files to be sent as text/plain.

Segfault
  • 8,036
  • 3
  • 35
  • 54