0 Replies Latest reply on Mar 12, 2008 6:30 PM by Nessmuk

    FTP download programming problem

    Nessmuk
      Hi,

      Thanks in advance for anyone's help on this. The programming was working fine for a good while and, with no changes to the programming has suddenly quit working. Everything seems to be set up just fine. The files are uploading to the ftp root directory on the server end and everything (file name and etc.) is going in the database as well.

      When you click the download link on the website for that particular file the browser goes to a blank browser page. The address bar refers to the correct template with the correct download name but it's just a blank browser page.

      I'm including the programming below of the download template since all the other code seems to be working okay. I've changed some of the names but the programming is the same.

      Thanks again for any response on this. I'll repost if there's a solution to let y'all know...

      ******


      <cfquery DATASOURCE="resources" name="download">
      SELECT download_file_name
      FROM download_table
      WHERE download_ID = #url.download_ID#
      </cfquery>

      <cfoutput query="download">

      <cfset File="#download_file_name#">
      <cfset LocalPath="d:\ftp\servername\ftproot\public\client\#download_file_name#">

      <!--- /////////////////////////////////////// /////////////////////////// --->

      <!--- Arguments --->
      <CFPARAM NAME="attributes.fpath" DEFAULT="d:\ftp\servername\ftproot\public\client\">
      <CFPARAM NAME="attributes.fname" DEFAULT="#download_file_name#">

      <!--- Check if filename is included in argument --->
      <CFIF #attributes.fname# IS NOT "">

      <!--- Used to check and see absolute path to see if file exists --->
      <CFSET fnameandpath = "#attributes.fpath##attributes.fname#">

      <!--- See if file actually exists --->
      <CFIF FileExists(fnameandpath)>
      <!--- //Force the browser to download the file and give it a filename. // --->
      <CFHEADER NAME="content-disposition" VALUE="attachment; filename=#attributes.fname#">
      <CFCONTENT TYPE="application/unknown" FILE="#fnameandpath#">

      <CFELSE>
      <!--- Guess not... --->
      <center><h1>Sorry, File Does Not Exist</h1></center>
      <CFABORT>
      </CFIF>

      <CFELSE>

      <!--- //Can't do anything without an argument// --->
      <center><h1>No File Selected</h1></center>
      <CFABORT>

      </CFIF>
      <!--- /////////////////////////////////////// /////////////////////////// --->

      </cfoutput>