Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Coldfusion 9.0.2 jpedal temp TIFF files not removed

We have a Windows 2003 R2 server running IIS 6, Coldfusion 9.0.2, jdk1.7.0_25. What we are seeing is there are thousands of .tif files being left behind in the windows temp folder. An example tiff file would be

c:\windows\temp\jpedal0.9518988844036744_38_HIRES_1294.tif

These tiff files are company logos that are included on every page of every invoice that gets printed. I am not too familiar with the file that creates and prints these files but this is what basically happens. There is the save content section that creates the doc to be printed. It then does a cfdocument to convert to pdf. I think it is this cfdocument tag that leaves these files behind. The cfdoc tag is

<cfdocument name="mypdfdoc"
            format="pdf"
            filename="#dir#\Invoices.pdf"
            overwrite="yes"
            fontembed="yes"
            mimeType="text/html"
            backgroundvisible="yes"
            margintop=".5"
            marginbottom=".5"
            marginleft=".5"
            marginright=".5">
            <cfoutput>#genPDFinvoice#</cfoutput>
            </cfdocument>

I see there is a CF9.0.2 Hotfix for pedal but we are using CF9.0.2. Any ideas what might be leaving these thousands of .tif files behind? Thanks in advance.
Joe
0
ckercher
Asked:
ckercher
  • 4
  • 3
  • 2
  • +1
1 Solution
 
Rodrigo MuneraCommented:
Seems like cfdocument makes http requests for relative resources, I don't know if this is causing the large mount of documents in the TMP folder but it would be worth giving it a try.

If you add the localURL attribute and set it to "yes", the cfdocument engine will look for the resource locally instead of issuing a http request and possibly (I don't know if this is the case) storing the image locally in the temp folder.

Source: http://www.carehart.org/blog/client/index.cfm/2011/11/19/perf_fix_via_cfdocument_localurl_attribute
0
 
Gurpreet Singh RandhawaWeb DeveloperCommented:
i don't think that above will solve his issue.

what exactly does this line have

            filename="#dir#\Invoices.pdf"

i would like to see how the contents within the invoice.pdf is being used,
0
 
ckercherAuthor Commented:
I cannot post that information here but is there something in particular you would suggest I look for in the Invoices.pdf file?
0
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 
Gurpreet Singh RandhawaWeb DeveloperCommented:
yes please check that
0
 
_agx_Commented:
I think it is this cfdocument tag that leaves these files behind.

CF uses several temp directories, unfortunately I've never found a complete listing of what they are and which ones are used by which tags/functions.

A very low tech approach, but you could confirm it by running the code for a single document. Check the temp directory before and after. If any new files are added, then you know something in the cfdocument code is creating tmp files.

you would suggest I look for in the Invoices.pdf file?

Yes, check the code for any references to URL's and/or images. Also, since you're saving the result to a pdf file (not displaying it in the browser)  what is the purpose of this attribute:   mimeType="text/html"  ?
0
 
ckercherAuthor Commented:
Thanks for your suggestions. @Rodrigo, we tried the localURL which dod not make a difference as you suspected. @agx, we have not checked the code yet but it is on the list. Something I did do until this gets resolved (if it ever will) is I created a scheduled task that removes files from that temp dir older than 1 day ... at least it keeps the disk usage down. Will follow up if there is any resolution.

Joe
0
 
_agx_Commented:
@ckercher - Welll code review would be a 2nd step. Try the low tech test first, since it's quick and easy ie Run <cfdocument name="mypdfdoc" ...> once. Check the number of files in the temp directory before and after. If it increases by +1, you know cfdocument is the culprit.

Like I mentioned, CF uses different directories for temp files. *Some* temp files it cleans automatically, like file uploads, charts, etc.... Though usually directories only used by CF. Could be it doesn't touch o/s temp directories, and let's the o/s clean up after itself.  If so, your solution sounds like a good workaround.
0
 
ckercherAuthor Commented:
Unfortunately the temp directory is constantly changing with new files being added and some files being removed so it would be difficult to monitor and know for sure that my test run created a file in the temp directory. I have decided to not pursue this further and let the scheduled task clean up the temp folder every night. Thanks for your suggestions.
0
 
_agx_Commented:
Ok. Assuming they are created by CF, your solution is the best workaround I can think of anyway. Other than changing the jvm temp directory.  

(Don't forget to close out the thread by marking your comment as the answer.)
0
 
ckercherAuthor Commented:
The answer is a work around, not a solution as to why the files are not being removed all of the time.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now