www.webdeveloper.com
Results 1 to 2 of 2

Thread: Download links for files on the server - help

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Posts
    51

    Download links for files on the server - help

    I'm pretty much at the beginner level of ColdFusion. I'm using the latest version of Railo. I have a page where I list files in a directory on the server. No problem there.

    When I link them, I'm not getting a prompt to download, it tries to go to a page which ends up not being found. I was told I need to use a combination of cfheader and cfcontent but I can't get it to work. The closest I've been is when I click a link, the page tries to load the file (mp3) in the browser so I just see a bunch of garbled text.

    I've looked at adobe livedocs and saw something at bennadel. Just can't make much sense of it.

    Any suggestions?

  2. #2
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    I know this is months old and you've probably given up on getting an answer, but CFCONTENT and CFHEADER is the way to go. Just make sure you've got the right MIME type specified.

    Code:
    <cfheader name="content-disposition" value="attachment;filename=[filename.ext goes here]">
    <cfcontent type="[mimetype value]" variable="[binary data]">
    I created a CFC that will return a mimetype based upon the file extension. I'll attach it for anyone who would like it.

    ^_^
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles