• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

CFContent failing on large files since moving to ColdFusion 9

Guest
Sep 28, 2010 Sep 28, 2010

Copy link to clipboard

Copied

Keep getting "The website canno display the page". It is ok when the file is 50MB, but when 300MB or above  - it failed.

It worked on CF8. We migrated to CF9 during the weekend and all the settings are the same.

I found that several CF users ran into similar issue - so I know it's not only me like Dan, Tom, etc (http://www.mail-archive.com/cf-talk@houseoffusion.com/msg348532.html)

Thanks,

Pat.

TOPICS
Advanced techniques

Views

3.9K

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

Oct 06, 2010 Oct 06, 2010

We are currently investigating this bug.

Votes

Translate

Translate
LEGEND ,
Sep 28, 2010 Sep 28, 2010

Copy link to clipboard

Copied

Firstly, I think you should o vote for the bug that's been raised to cover this:

http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=83425


I've not played with this at all, but it looks to me like this is similar to a thing older versions of CF used to have when serving up files with <cfcontent>: the whole file gets loaded into RAM, and only then spooled back to the browser.

I wonder if it would be possible to just used <cfcontent> to set the MIME type, and then used <cfflush interval="somethingSensible">, fileRead() or fileReadBinary() and <cfoutput> to read&spool the file at the same time?  This might also be quicker given the data is being spooled at the same time as it's being read, rather than being done in series.

That said... this is entirely speculation on my part... amn't in the position to test this approach at the mo', sorry.

--

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
Guest
Sep 30, 2010 Sep 30, 2010

Copy link to clipboard

Copied

Thank you, Adam.  For now - we decided to downgrade back to CF8. Everything is working ok now.

I will look into your suggest/method within the next few weeks and post the results/findings since we still have CF9 on our Dev environment and it's making the same fuss with larger files.

CF9 have some good / awesome tags for map and media - it's a bum that me/team will not be able to show this awesomeness to the users sooner

Thanks again,

Pat.

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 ,
Sep 30, 2010 Sep 30, 2010

Copy link to clipboard

Copied

I will look into your suggest/method within the next few weeks and post the results/findings since we still have CF9 on our Dev environment and it's making the same fuss with larger files.

Cool.  I'd be keen to hear how you go.  If I find any time, I'll have a look @ it myself, but I am very bogged down with work @ the mo'.

--

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
Guest
Sep 30, 2010 Sep 30, 2010

Copy link to clipboard

Copied

On the same boat- so busy @ work and still many things to work on. Hopefully will have time to relook into this within the next few weeks.

I will keep you posted about this cfContent thing.

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
Guest
Oct 04, 2010 Oct 04, 2010

Copy link to clipboard

Copied

Adam,

I was able to obtain a CFC that works around the cfContent and it seems to be working with CF9 on our dev environment.

Also found out that Adobe admitted that it is a bug in CF9 and will address this in CF10. So, for those out there who use cfContent and thinking about upgrading to CF9 --- don't waste your money like me/team did.

If you would like to see the code - please let me know.

Pat.

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 ,
Oct 05, 2010 Oct 05, 2010

Copy link to clipboard

Copied

If you would like to see the code - please let me know.

Yeah, I would.

--

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
Guest
Oct 05, 2010 Oct 05, 2010

Copy link to clipboard

Copied

Email me at pat_300ce@yahoo.com so that I can forward you the code.

Pat.

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
Oct 06, 2010 Oct 06, 2010

Copy link to clipboard

Copied

We are currently investigating this bug.

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
New Here ,
Feb 04, 2011 Feb 04, 2011

Copy link to clipboard

Copied

This has caused me a bit of a nightmare. When you upgrade versions, you expect things to at least improve. This has to be a priority fix - it's a howling problem!

Anyhow, for the benefit of others in a similar situation, I eventually got around this by creating a read-only FTP account (literally read-only - the user can't even list files/directories) on our web server and then I use a cflocation redirect instead of the cfcontent approach to serve up the file. I use UUIDs as folder names, so it's a pretty safe way of stopping people from downloading content they shouldn't.

So, instead of this...

<cfset Path = "#pathToMyFile#\#myFileName#">

<cfset FileInfo = GetFileInfo(Path)>
<cfset FileSize = FileInfo.size>
<cfset MimeType = getPageContext().getServletContext().getMimeType(Path)> <!--- Sometimes doesn't work, so we need to check that MimeType exists below --->

<cfheader name="Content-Disposition" value="attachment; filename=""#myFileName#""">

<cfheader name="Expires" value="#Now()#">
<cfheader name="Content-Length" value="#FileInfo.size#">
<cfif IsDefined("MimeType")>
     <cfcontent type="#MimeType#" file="#Path#" deletefile="No">
<cfelse>
     <cfcontent type="application/octet-stream" file="#Path#" deletefile="No">
</cfif>

I now have this...


<cfset FTPDownloadLink = "ftp://myAnonymousUser@ftp.mydomain.com/myFTPPath/#myFileName#">
<cflocation url="#FTPDownloadLink#" addtoken="no">

I suspect that this is actually a better way of doing things anyway, since it offloads responsibility to serving the file from the CF server to the FTP, which is, after all, what it is designed to do.

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
New Here ,
Feb 11, 2011 Feb 11, 2011

Copy link to clipboard

Copied

To fix this:

  1. Login to the administrator panel for Coldfusion 9.x
  2. Choose Java and JVM
  3. Set the " " to 1024 or appropriate value. Old value was 512 MB and seems to not be enough.
  4. Restart Coldfusion services.

Seems to be an with memory needed for Java and I was able to download large files afterwards on my 64-bit OS with CF 9.01.

Enjoy.

Jon Almada

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
New Here ,
Feb 21, 2011 Feb 21, 2011

Copy link to clipboard

Copied

LATEST

http://www.bennadel.com/blog/1227-Using-ColdFusion-To-Stream-Files-To-The-Client-Without-Loading-The-Entire-File-Into-Memory.htm

Better solution than working on memory issues. Check this link for Ben's solution.

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