Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
CFCONTENT and CFHEADER working from Actionscript getURL, but n

CFCONTENT and CFHEADER working from Actionscript getURL, but n

2004-03-12       - By emanuelcosta@(protected)

 Back
Try:

<cfset
localfilename="#GetDirectoryFromPath(GetBaseTemplatePath())#storage\DOC_#URL
EncodedFormat(URL .document_id)#.aaf">

That's probably because the different ways that CF and Flash parses url
variables.


HTH

Emanuel Costa

-- -- Original Message -- --
From: "Craig Earls" <c.earls@(protected)>
To: <flashcoders@(protected)>
Sent: Thursday, March 11, 2004 9:44 PM
Subject: [Flashcoders] CFCONTENT and CFHEADER working from Actionscript
getURL, but not from HTML Anchor


I am storing a grunch of files of different types in a directory on my
server. For obscurity (don't ask it's a legal thing) I store them with names
like DOC_**.AAF  Where the ** is an id number.  I store the mime type and
orignal filename in a database table.  My Flash application calls a
coldfusion template called download.cfm with a URL variable with the
document id number.  The template looks up the data in the data base and
sends a page back with CFHEADER and CFCONTENT set to download the
appropriate file with the correct filename.  This works in both Netscape and
IE when called from Flash using getURL and a javascript call to pop up an
undecorated window.

If I call the same page using an anchor from an HTML page it doesn't work.
IE tries to name the file "download.cfm?document_id=**" and can't find the
file to download. It is as if the CFCONTENT and CFHEADER were being ignored.
I have check to verify that they are getting good values.

Here is the code from download.cfm:

 <cfif metadata.recordCount GT 0>
<cfset
localfilename="#GetDirectoryFromPath(GetBaseTemplatePath())#storage\DOC_#URL
.document_id#.aaf">
<cfheader name="content-disposition"
value="attachment;filename=#metadata.file_name#">
<cfcontent
type="#metadata.contenttype#/#metadata.contentsubtype#"
file="#localfilename#">

</cfif>

Can anybody explain why this technique works fine when called using
Actionscript

getURL("http://"+server+"/Users/download.cfm?document_id=" +
documentObj.document_id);


But this HTML won't:

<a href="http://www.mydomain.com/Users/download.cfm?document_id=**" >The
Real Filename.ext</a>



=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106713
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)





=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106719
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)




Earn $52 per hosting referral at Lunarpages.