user3427540
user3427540

Reputation: 1172

Is there any file size limitation for content-disposition in Coldfusion?

Recently I was working with cfcontent tag to download some files by the browser. This snippet of code is working when my file size is up to around 900MB. However, with larger sizes (currently my file size is 2.5 gb) the page loads, but there is no pop up asking the user to download the files.

<cfheader name="Content-disposition" 
       value='attachment;   filename="Questionnaire_files.zip"'>
<cfcontent variable="#filereadbinary('#path#Questionnaire_files.zip')#" 
       type="application/x-zip-compressed">

So is there any limitation with cfcontent file size?

Upvotes: 3

Views: 1178

Answers (2)

Ronnie Kumar
Ronnie Kumar

Reputation: 635

Writing and Downloading File size like 2.5 gb may give you request timeout error or jvm outofmemmory error depends on your jvm setup. I would let client chose the location to store the file and write it there in pieces. By writing it in pieces you are saving run time memory. And ofcose performance will increase

Upvotes: 1

Jedihomer Townend
Jedihomer Townend

Reputation: 400

Off the top of my head I would say no, however you are performing a FileReadBinary() which will read the file into memory and therefore have memory limitations, set in your JVM config. Have you tried just using

<cfheader name="Content-disposition" 
   value='attachment;   filename="Questionnaire_files.zip"'>
<cfcontent file="#path#Questionnaire_files.zip" 
   type="application/x-zip-compressed">

Upvotes: 3

Related Questions