• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFContent - works sometimes, sometimes not.

Explorer ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

CFContent has always been tragically clunky (Send flames to NULL@alienetworks.com); why is this so hard to get right? Here's the relevent code excerpt from the app I have that works everywhere:

<CFHeader
Name = "content-disposition"
Value = "inline; filename=#pcFileName#"/>
<CFContent
Type = "application/octet-stream"
deleteFile = "no"
File = "#filePath#\#pcFileName#"
Reset = "yes">

...this works fine with any browser we've tried, and is currently serving product to both PC's and Mac's. No problems. On the same box, I also have an application that has this:

<CFHeader Name = "content-disposition" Value = "inline; filename=#theSaveName#">
<CFContent Type = "application/octet-stream" deleteFile = "no" File = "#theSourceFile#" Reset = "yes">

...this works fine with Opera, but not with IE. IE grinds for a moment, and then says:

'Internet Explorer cannot download / from xxxxx.alienetworks.com.'
'Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.'

Yes, the paths are correct. No, permissions aren't an issue (it works in Opera, remember?). The directory name is diferent, but even with the same test file (a zip file), I get the same results. I've tried both inline and attachment, and I've tried hardcoding the MIME type and letting the server determine it with getPageContext().getServletContext().getMimeType(theSourceFile). I've also tried both a clean URL and the old ' http://qwe.qweqweqwe.com/template.cfm/sourcefile.zip' trick.

Thanks!
TOPICS
Advanced techniques

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , May 20, 2008 May 20, 2008
No, actually, here’s the deal – not everyone on the boards got into CF just out of college because they thought it would be a hoot to do web pages – some of us have been around since Jeremy was compiling dbml.exe on his couch. I apologize for upsetting you with my answer; to be honest, you’re response ‘…meaningless and naïve..’ is fairly inaccurate and somewhat insulting; knowing nothing of the processes we have in place for managing a database of over 60 million Americans and their health recor...

Votes

Translate

Translate
Engaged ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

Have you tried attachment instead of inline?

I can't tell from your post if this is a dev or production box. The developer version of CF adds a nice little html comment header to the output which will screw up delivery of files when using cfheader and cfcontent.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

As mentioned in the post, I've tried both inline and attachment. 🙂 I've also tried hardcoding the MIME type. No love. This is all running on CF8 Ent, in a production environment.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

That's a good thing to know! Unfortunately, my 'Enable content expiration' box was already unchecked. It did give me the idea, however, to confirm that the MIME types were already in place and correct. They are, so I'm still looking. Thanks! 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

did you check (as in 'looked at') that "enabe content..." box for the
actual directory that IE can't download from, or only for the webroot?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

I'm using CFContent, and the directory is outside the Webroot, so IIS doesn't have anything to do with enabling content over there. The process with the problem is in the web directory root. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 19, 2008 May 19, 2008

Copy link to clipboard

Copied

> That's a good thing to know! Unfortunately, my 'Enable content expiration' box
> was already unchecked. It did give me the idea, however, to confirm that the
> MIME types were already in place and correct. They are, so I'm still looking.
> Thanks! :)

Just to isolate the problem a bit more, try using the internal JRun web
server instead of IIS and test again.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 20, 2008 May 20, 2008

Copy link to clipboard

Copied

I may try that as a last resort; this is a server under load, and I'm not sure how much of a pain in the *** it would be to gracefully start up JRun with all of our weird extra processes and try to get it configured to work without shutting down the other stuff.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 20, 2008 May 20, 2008

Copy link to clipboard

Copied

> I may try that as a last resort; this is a server under load, and I'm not sure
> how much of a pain in the *** it would be to gracefully start up JRun with all
> of our weird extra processes and try to get it configured to work without
> shutting down the other stuff.

Can you not replicate this as an isolated stand-alone case, without going
through your entire app (which sounds complex)? EG: a basic stand-alone
CFM file which simply has the code you initially quoted (or facsimile
thereof)?

You should not have to run your test case in the context of your entire
app.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 20, 2008 May 20, 2008

Copy link to clipboard

Copied

"You should not have to run your test case in the context of your entire
app." -- I don't agree. I have the same/similar code running in production and in dev environments, and in production, we have a *lot* of other processes in place to implement requirements and guidelines as specified by the OIG, the FDA and HIPAA. I already know the code works fine in a clean dev environment - I need it to run in the existing environment that implements our business processes; just like the other very similar piece of code does. Thanks tho. :)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 20, 2008 May 20, 2008

Copy link to clipboard

Copied

I totally skipped over your mention of trying Attachment, sorry about that.

Sounds like you're working in a validated environment. You do mention "Clean Dev", but is the dev environment exactly the same as the production environment? If you have it working in Dev and it doesn't work in Production, you have to focus on the differences. Assuming you can overcome any nTier architecture issues, maybe you can get permission to make a vmware image of the production system and isolate it for troubleshooting?

I would follow Adam's idea of isolation. Create a test folder in a subdirectory of the application and put an empty Application.cfm or an empty Application.cfc in it just to stop anything up the chain. Put in a test case cfm that delivers a specific file and see if that works.

If you've got HIPAA concerns, I'm guessing you've got some security involved in the site. While you don't specfically mention it, are you using SSL? Azadi's link has a reference to cache issues regarding SSL towards the bottom. A quick Google on the exact error message without using the ColdFusion keyword produced the following Microsoft Article regarding SSL and cache headers. The cache may still be a good place to start looking even if you are not using SSL.

http://support.microsoft.com/kb/316431

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 20, 2008 May 20, 2008

Copy link to clipboard

Copied

On Tue, 20 May 2008 18:47:10 +0000 (UTC), Scatterblak wrote:

> "You should not have to run your test case in the context of your entire
> app." -- I don't agree. I have the same/similar code running in production and
> in dev environments, and in production, we have a *lot* of other processes in
> place to implement requirements and guidelines as specified by the OIG, the FDA
> and HIPAA. I already know the code works fine in a clean dev environment - I
> need it to run in the existing environment that implements our business
> processes; just like the other very similar piece of code does. Thanks tho. :)

Here's the thing. You want help with your issue. I don't *really* care if
you solve your issue or not, however I'm prepared to give you a hand, but
you kinda need to throw us / me a bone here: help us to help you. My -
fairly informed - advice is to try to contrive a simple replicable case in
your production environment, as this will be easier to tinker with and
accordingly possibly resolve. Also, if you need to escalate it to Adobe
support, it's a more transportable case to present to them.

Your position of "but it works everywhere else" is meaningless and naive:
we don't care where it *does* work, we care where it *doesn't* work.

The answer to this is not going to be something like "oh yeah, there's this
bug in ColdFusion, you need to press CTRL-G to fix it"; it's going to be
slightly less obvious than that, and it might require you trying out some
things people suggest.

You have to decide whether you actually want to try some stuff to fix your
issue, or you just want to talk about it.

I'm all for trying some stuff.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 20, 2008 May 20, 2008

Copy link to clipboard

Copied

LATEST
No, actually, here’s the deal – not everyone on the boards got into CF just out of college because they thought it would be a hoot to do web pages – some of us have been around since Jeremy was compiling dbml.exe on his couch. I apologize for upsetting you with my answer; to be honest, you’re response ‘…meaningless and naïve..’ is fairly inaccurate and somewhat insulting; knowing nothing of the processes we have in place for managing a database of over 60 million Americans and their health records (over 230K tables with more than 15 billion data points), all in a HIPAA/OIG/FDA conformal format, you assume that reticence for setting up a ‘simple replicable case in my production environment’ is due to just wanting to wait and hope for a quick fix? “It’s going to be something less obvious than that”, “...it might require you trying out some things people suggest.”, etc? Here’s the short version: Your post was insulting, and while I’m all for ‘trying out some stuff’ myself, I need to carefully assess which things to try out. After beta-testing the original CF (consulting for NetGrocer among others, dbml.exe version 1), consulting directly with Macromedia on template encryption and alternative algorithms (CFMX / Neo, etc) and currently beta testing for Adobe while working with third-part vendors on new software registration processes for same, I’m fairly well armed to decide what I need to try and what I can safely skip. In our case, it turns out that some of the dynamic files generated by one of our data partners prior to uploading had two trailing characters that ended up (usually a Chr(004)+Chr(010) – probably txEnd from one of the legacy data storage machine, and a clumsy backspace effort to remove it. Sometimes a Chr(027), etc) in the generated URL. For some of these, opera ignored them if they were on the end of the file name, but IE always took them literally, and since filenames were trimmed prior to writing, IE could never find the file.

So no, it wasn’t as simple as hitting ctrl-g. But thanks anyway. I’ll mark this as closed. Feel free to not reply – trying to sell yourself as helpful doesn’t hide the attitude, and I can tell you, it isn’t welcome here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation