macromedia.coldfusion.database_access
[Top] [All Lists]

Re: Downloading files from IMAGE datatype on SQL Server, old coldfusion

Subject: Re: Downloading files from IMAGE datatype on SQL Server, old coldfusion runtime
From: "benmay123" <webforumsuser@xxxxxxxxxxxxxx>
Date: Sun, 24 Feb 2008 13:16:40 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

Ok here is the code:

        <cfquery name="getResume" datasource="#session.mainDS#">
        select resume, resume_mime_type, resume_file_ext
        from
        dbo.applicant_users
        where applicant_user_id = 
        <cfqueryparam cfsqltype="cf_sql_integer" 
value="#getAppUserId.applicant_user_id#">
        </cfquery>

        <cfset filename="#user_login#_resume#getResume.resume_file_ext#">

        <cffile action="write" file="./#filename#" output="#getResume.resume#">
        
        <cfheader name="Content-Disposition" value="attachment; 
filename=#filename#">
        <cfcontent type="#getResume.resume_mime_type#" file="./#filename#">

 If I exclude the last two lines (cfheader and cfcontent) the page loads but it 
does not appear that any file is created. The relative path should work yes? 
The reason I ask is that I have access to these pages via a SMB mount and I 
have no idea the absolute path on the drive where the files live. I could find 
out but not on a sunday morning. :)

 If I include the final two lines, I get this error message:

 An error occurred while attempting to open the file. Windows NT error number 2 
occurred.

 Now it appears to me there may be two problems. One is that the file is 
actually being written but I don;'t know where it's being saved to. The second 
is that it's not being written. Thoughts?

 Thanks for all your help so far, it's nice to know there's helpful programmers 
out there. 


<Prev in Thread] Current Thread [Next in Thread>