Skip to main content
September 21, 2012
Question

CFFile Write Issue

  • September 21, 2012
  • 1 reply
  • 493 views

This one is kind of strange...

I'm querying Clearquest which stores documents (Word, Powerpoint, etc.) in a blob (Oracle).  I'm using cffile to take that object and write to a directory on my file server using variables for my destination (see below).  This all previously worked when I was allowed to write to my web server and we were on CF 7.  Now, I'm on CF 9 and have to store documents (non-code) on the file server.  What is happening is this.  If I try and download and write an Excel file, it works fine provided there are no images imbedded.  Same with Word and PowerPoint.  If a document has images, the first image will be writted about 70% and then the remainder of THAT image is black.  Subsequent images don't display at all.  I can find nothing on this and frankly, I'm stumped.

Below is my code.



I query the blob:

select data from attachments_blob where attachments_dbid = '#url.dbid#'

Set the MIME types for the "accept" in cffile: cfset OFFICE2007MimeTypes = "image/jpeg,image/pjpeg,image/gif,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/vnd.ms-powerpoint,application/x-shockwave-flash,application/pdf,text/plain"

Use cffile to write the new file

cffile action="WRITE" file="#session.file_location#/ClearQuest/eticket/attachments/#url.filename#" output="#getDoc.data#" addnewline="No" accept="#variables.OFFICE2007MimeTypes#"

Call the file to open it up

cfcontent type = "#variables.type#"

cflocation url="#variables.file#"

    This topic has been closed for replies.

    1 reply

    WolfShade
    Legend
    September 21, 2012

    Off the top of my head, I would guess that the text is downloaded, first, then the images, and by the time the first image is being downloaded there might be some sort of buffer issue, or download issue.  Have you checked with Clearquest to see if they've ever had another client that experienced the same issue?

    ^_^