Solved

Coldfusion 9.0.2 jpedal temp TIFF files not removed

Posted on 2014-03-31
10
430 Views
Last Modified: 2014-04-29
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
Comment
Question by:ckercher
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 4

Expert Comment

by:Rodrigo Munera
Comment Utility
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
 
LVL 15

Expert Comment

by:myselfrandhawa
Comment Utility
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
 

Author Comment

by:ckercher
Comment Utility
I cannot post that information here but is there something in particular you would suggest I look for in the Invoices.pdf file?
0
 
LVL 15

Expert Comment

by:myselfrandhawa
Comment Utility
yes please check that
0
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:ckercher
Comment Utility
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
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
@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
 

Accepted Solution

by:
ckercher earned 0 total points
Comment Utility
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
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
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
 

Author Closing Comment

by:ckercher
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now