Ok I have this file, which we will receive automatically.
The first part of the file is hex code data, which can be read easily,
even manipulated etc. The 2nd part of the file is binary data.
When I use CFFILE to READ the file it reads it fine comes back
with no errors, but when I output what it read it only
saves up to where the hex code ends.  Meaning all the binary is not
read nor is it added to the CFFILE variable for output.  The
same thing happens using CFHTTP it reads only the first part yet it
can see the ENTIRE file size, and comes back w/ no error just partial data.

I don't want to send the file to the list because it's quite large (600K),
the hexcode part it is only about the 1st K of the file. But if you want
a copy to play around with, if you think you can help, I can send you one.

The perdicament is this.  I have to edit data in the first part (hexcode)
of the file.  I have been able to do this successfully when I do
not include the binary portion of the file.  I READ the file and then change
data and then WRITE the file out. But since reading the file only pulls the
first
portion the binary part does not get written.

If I try READBINARY then I can't manipulate the hex code part.
The binary standard they are using (if it makes a difference is)
Wavelet Scalar Quantization (WSQ). Ultimately I would like to be able to
just
manipulate the data in one file if that won't work then possibly strip OUT
the first part of the file (after making a copy) so I can just save the
binary.
Then in another file make all my changes to the hex (first part of the file)
code
and then somehow put the 2 pieces back together.

My code looks like this (actually I have tried this a number of ways even
with ASP and it still only grabs the initial part of the file)
CF CODE:
<CFSET tempfolder = "D:\Inetpub\www\dev\kelly\test\">
<CFDIRECTORY action="LIST" directory="#tempfolder#"  name="newfiles">
<CFFILE ACTION="Read" FILE="#tempfolder#efts.sub"  VARIABLE="test">
<CFOUTPUT>#test#</CFOUTPUT>

Then I played around with using READBINARY
<CFSET tempfolder = "D:\Inetpub\www\dev\kelly\test\">
<CFDIRECTORY action="LIST" directory="#tempfolder#"  name="newfiles">
<CFFILE ACTION="Readbinary" FILE="#tempfolder#efts.sub"  VARIABLE="test">
<CFSET abinaryobj=tobase64(test)>
This does infact pull the whole file but of course now it's tobase64 (not
even really 
familiar w/ this) and not hexcode...

W/ ASP I tried:
<%
Set fs=Server.CreateObject("Scripting.FileSystemObject")

Set f=fs.OpenTextFile(Server.MapPath("test.sub"), 1)
Response.Write(f.ReadAll)
f.Close

Set f=Nothing
Set fs=Nothing
%>
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to