0

Intranet website.

I have a web page using Coldfusion/Lucee/CommandBox displaying a list of servers. Next to a server is an icon that is linked to a verified working RDP file.

If I double-click directly from the explorer, they'll open just fine. If I try to download them from the website, I'll get a "Couldn't download - Network issue". That made me think it was a GPO issue as it was happening in Chrome and Edge. However, in AWS, I CAN download an RDP profile. I inspected the AWS source code but it's very difficult to make sense of it. I also reviewed the downloaded RDP file using Notepad++. I also took this AWS downloaded file and placed it on my web page and hardcoded the link. The same AWS rdp file will not download.

Does anyone know what AWS is doing to make this work?

And

Does anyone know how I can link to my RDP file and have it download like most any other file?

SRVNM001 <a href="/?action=serverList"><i class="fa fa-wrench"></i></a><a href="/docs/RDP/SRVNM001.rdp" download>RDP</a>
HPWD
  • 2,232
  • 4
  • 31
  • 61
  • 1
    Have you any webserver setup in front? Looks to me like an webserver/undertow configuration issue. – AndreasRu Jul 01 '23 at 03:37
  • 1
    Sounds like your web server needs to be configured to allow .rdp files, and you probably need to do something so that you can deliver them as a download. Same thing with any other file, like .pdf. – Redtopia Jul 01 '23 at 23:19
  • This is a server configuation issue, not a programming issue. https://serverfault.com/questions/335982/iis-not-allowing-me-to-server-files-with-rdp-extension – Adrian J. Moreno Jul 03 '23 at 19:05

1 Answers1

0

I was missing a cfheader refernce. cfheader(name="Content-Disposition",value="attachment;filename=#local.fileName#.rdp" );

<cfscript>
local.fileName = url.serverName;

local.fileContents = "auto connect:i:1
full address:s:#url.serverName#";
local.filePath = "/downloads/RDP/#local.fileName#.rdp";

try{
    FileWrite(local.filePath, local.fileContents);

    cfheader(name="Content-Disposition",value="attachment;filename=#local.fileName#.rdp" );
    cfcontent(file=local.filePath, type="text/plain" );

} catch (any e) {
    writeOutput("An error occurred creating the RDP file. Error: " & e.message);
    abort;
}
</cfscript>
HPWD
  • 2,232
  • 4
  • 31
  • 61