Re: jFileUpload - putting binary file fragments together (was: State of cffileupload)
Random-ness-ish-ness: You could potentially toss in the Apache FileUpload project. I was talking with someone about this over the weekend. It looks like you could just stick the needed code in a CFML page, CFML-ized from Java, and post the upload form to that CFML page and let it handle the upload. I suggested using the servlet approach-- you'd post your form to /uploads and then have CF check the uploads directory for file completion, or hack up the servlet to ping a CFM page when the state of the upload changes. Theoretically, you could test the basic premise out pretty easy by just using a JSP example of FileUpload, as CF can run JSP pages without much fuss, IIRC. It appears that Railo uses FileUpload under the hood, I haven't checked but I think Adobe uses something else. Could be wrong tho. http://commons.apache.org/fileupload/ Here's an example JSP that might get you going (using the servlet is probably easiest tho): http://www.developershome.com/wap/wapUpload/wap_upload.asp?page=jsp3 It looks like the FileUpload library can tell you how much has been uploaded, as it's uploading, potentially allowing for an accurate progress bar, too! Just a thought. :Den -- We should not say that one man's hour is worth another man's hour, but rather that one man during an hour is worth just as much as another man during an hour. Time is everything, man is nothing: he is at the most time's carcass. Karl Marx On Tue, Jul 27, 2010 at 11:15 AM, Thomas Harper wrote: > > Well, the issue I was having with cffileupload is now considered a bug > (83447) and while we're waiting for our platinum plan (if going that route > will even work), I'm checking out jFileUpload. What it does is split larger > files into chunks of a size designated by an attribute. In my case, I'm > splitting it into 256 MB apiece. Uploading is taken care of by a .cfm they > provide, but it doesn't put split-up files back together. Using cffile with > append would only work on text files. How would ColdFusion put the file > together? These files will be really big binaries of about 4 to 5 GB. Thank > you. > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335773 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
jFileUpload - putting binary file fragments together (was: State of cffileupload)
Well, the issue I was having with cffileupload is now considered a bug (83447) and while we're waiting for our platinum plan (if going that route will even work), I'm checking out jFileUpload. What it does is split larger files into chunks of a size designated by an attribute. In my case, I'm splitting it into 256 MB apiece. Uploading is taken care of by a .cfm they provide, but it doesn't put split-up files back together. Using cffile with append would only work on text files. How would ColdFusion put the file together? These files will be really big binaries of about 4 to 5 GB. Thank you. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335766 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Binary File
I have an Adobe Air application that will post a file to a cfc. The cfc accepts the file fine. and I can process it and actually post to another web service for processing. Doing this in the xml #ToBase64(arguments.foo)# Is it possible to determine the file name and mime type when accepting a binary file like this? File type could be .doc, .pdf etc ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310070 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Read large binary file, MX7?
>I strongly suggest you consider my second suggestion, which was to take CF >out of the file service process altogether. Generate a symbolic link within >CF, and delete the link when it's no longer needed. > >Dave Watts, CTO, Fig Leaf Software @Dave - I know this is an old post, but I'm curious and don't quite understand what you mean by "symbolic link within CF." I'm familiar with the term in Un*x systems, such as "ln -s myLink /path/someFile", but I know that's not what you mean. Could you explain? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:302634 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Read large binary file, MX7?
The byteArray is a Java array object, so CF's arrayLen() function would not work on it. You'd need to use the array's length method like this: response.setContentLength(byteArray.length()); Java's file class also has a length() method that returns the file size in bytes. I'm not a Java programmer, but it appears that the code you posted streams the file to the browser. If that functionality is not needed, you might want to use Dave Watts' suggestion using symbolic links. On Jan 21, 2008 4:51 PM, Dave Watts <[EMAIL PROTECTED]> wrote: > > CFCONTENT was being used previously, but when a bunch of > > users start downloading large files, the server starts crashing... > > Most of the files range between 200-500 MB, some up to 1GB > > and larger... > > I strongly suggest you consider my second suggestion, which was to take CF > out of the file service process altogether. Generate a symbolic link > within > CF, and delete the link when it's no longer needed. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > > Fig Leaf Software provides the highest caliber vendor-authorized > instruction at our training centers in Washington DC, Atlanta, > Chicago, Baltimore, Northern Virginia, or on-site at your location. > Visit http://training.figleaf.com/ for more information! > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297040 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Read large binary file, MX7?
> CFCONTENT was being used previously, but when a bunch of > users start downloading large files, the server starts crashing... > Most of the files range between 200-500 MB, some up to 1GB > and larger... I strongly suggest you consider my second suggestion, which was to take CF out of the file service process altogether. Generate a symbolic link within CF, and delete the link when it's no longer needed. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297036 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Read large binary file, MX7?
CFCONTENT was being used previously, but when a bunch of users start downloading large files, the server starts crashing... Most of the files range between 200-500 MB, some up to 1GB and larger... - Original Message - From: "Craigsell" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, January 21, 2008 4:32 PM Subject: Re: Read large binary file, MX7? > Dave is right --- when in CF use CF! > > Here's a code snippet fron June 19,2003 entry is Chris Cantrell's blog > (he's > an Adobe expert) > http://weblogs.macromedia.com/cantrell/archives/coldfusion/index.cfm > > > variable="pic"/> > > >writeOutput(toString(pic)); > > > Just change the content type to what you need! > > > - Original Message - > From: "Sarah Geren" <[EMAIL PROTECTED]> > To: "CF-Talk" > Sent: Monday, January 21, 2008 2:38 PM > Subject: Re: Read large binary file, MX7? > > >> thanks, >> I was actually originally trying to use this piece of code that I found >> using java to read through the object, but I am so not a Java person and >> got >> stuck when I needed to add the following parameter: >> response.setContentLength(arrayLen(byte_arry_here)); >> into the script so that the browser knows how much it is downloading... >> I tried: >>response.setContentLength(arrayLen(instream)); >>response.setContentLength(arrayLen(byteArray)); >>response.setContentLength(arrayLen(s_file)); >> but none worked... So I gave up and decided to use cfffile, until >> realizing >> how large some of the files were. I just wasn't sure if there was >> something >> else I could do with cffile that would make my original code work... >> >> So can someone tell me instead how to call the content length into the >> script below please? >> >> >> function f_Stream(s_file,i_seek,MIME_TYPE,fileName) { >> var i_position = i_seek; >> var i_buffer = 1; >> var byteClass = createObject("java", "java.lang.Byte"); // >> var byteArray = >> createObject("java","java.lang.reflect.Array").newInstance(byteClass.TYPE, >> i_buffer); >> var context = getPageContext(); >> var response = context.getResponse().getResponse(); >> >> var instream = createObject("java", "java.io.FileInputStream"); >> var outstream = response.getOutputStream(); // take over control of the >> feed to the browser >> if(structKeyexists(arguments,"MIME_TYPE")) >> response.setContentType(MIME_TYPE); >> if(structKeyExists(arguments,"fileName")) >> response.setHeader("content-disposition","attachment; >> filename=#fileName#"); >> byteClass.Init(1); >> instream.init(s_file); >> context.setFlushOutput(false); >> try { >> if(i_seek GT 0) { >>//instream.skip(i_seek); >>//outstream.write(toBinary('RkxWAQEJCQ==')); // output the >> header bytes >> } >> do { >>i_length = instream.read(byteArray,0,i_buffer); >>if (i_length neq -1) { >> outstream.write(byteArray); >> outstream.flush(); >> } >> } while (i_length neq -1); // keep going until there's nothing left to >> read. >> } >> catch(any excpt) {} >> outstream.flush(); // send any remaining bytes >> response.reset(); // reset the feed to the browser >> outstream.close(); // close the stream to flash >> instream.close(); // close the file stream >> } >> >> > f_Stream("#scene_data.mpeg#",0,"video/mpeg","scene_#scene_id#.mpg")> >> >> >> >> - Original Message - >> From: "Sonny Savage" <[EMAIL PROTECTED]> >> To: "CF-Talk" >> Sent: Monday, January 21, 2008 3:07 PM >> Subject: Re: Read large binary file, MX7? >> >> >>> Any time I find a bottleneck with CF tags, I generally go looking for a >>> Java >>> solution. These pages may have useful snippets... >>> http://www.coldfusionmuse.com/index.cfm/2006/10/26/Java.directory.list >>> http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html >>> http://www.scripts.com/coldfusion-scripts/file-manipulation-scripts/ >>> >>> On Jan 21, 2008 2:27 PM, Sarah Geren <[EMAIL PROTECTED]> wrote: >>> >>>> Hello, >>>> >>>> I have an application which uses CFFILE to read a binary file into a >>>> variable, and that variable
Re: Read large binary file, MX7?
Dave is right --- when in CF use CF! Here's a code snippet fron June 19,2003 entry is Chris Cantrell's blog (he's an Adobe expert) http://weblogs.macromedia.com/cantrell/archives/coldfusion/index.cfm writeOutput(toString(pic)); Just change the content type to what you need! - Original Message - From: "Sarah Geren" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, January 21, 2008 2:38 PM Subject: Re: Read large binary file, MX7? > thanks, > I was actually originally trying to use this piece of code that I found > using java to read through the object, but I am so not a Java person and > got > stuck when I needed to add the following parameter: > response.setContentLength(arrayLen(byte_arry_here)); > into the script so that the browser knows how much it is downloading... > I tried: >response.setContentLength(arrayLen(instream)); >response.setContentLength(arrayLen(byteArray)); >response.setContentLength(arrayLen(s_file)); > but none worked... So I gave up and decided to use cfffile, until > realizing > how large some of the files were. I just wasn't sure if there was > something > else I could do with cffile that would make my original code work... > > So can someone tell me instead how to call the content length into the > script below please? > > > function f_Stream(s_file,i_seek,MIME_TYPE,fileName) { > var i_position = i_seek; > var i_buffer = 1; > var byteClass = createObject("java", "java.lang.Byte"); // > var byteArray = > createObject("java","java.lang.reflect.Array").newInstance(byteClass.TYPE, > i_buffer); > var context = getPageContext(); > var response = context.getResponse().getResponse(); > > var instream = createObject("java", "java.io.FileInputStream"); > var outstream = response.getOutputStream(); // take over control of the > feed to the browser > if(structKeyexists(arguments,"MIME_TYPE")) > response.setContentType(MIME_TYPE); > if(structKeyExists(arguments,"fileName")) > response.setHeader("content-disposition","attachment; > filename=#fileName#"); > byteClass.Init(1); > instream.init(s_file); > context.setFlushOutput(false); > try { > if(i_seek GT 0) { >//instream.skip(i_seek); >//outstream.write(toBinary('RkxWAQEJCQ==')); // output the > header bytes > } > do { >i_length = instream.read(byteArray,0,i_buffer); >if (i_length neq -1) { > outstream.write(byteArray); > outstream.flush(); >} > } while (i_length neq -1); // keep going until there's nothing left to > read. > } > catch(any excpt) {} > outstream.flush(); // send any remaining bytes > response.reset(); // reset the feed to the browser > outstream.close(); // close the stream to flash > instream.close(); // close the file stream > } > > f_Stream("#scene_data.mpeg#",0,"video/mpeg","scene_#scene_id#.mpg")> > > > > - Original Message - > From: "Sonny Savage" <[EMAIL PROTECTED]> > To: "CF-Talk" > Sent: Monday, January 21, 2008 3:07 PM > Subject: Re: Read large binary file, MX7? > > >> Any time I find a bottleneck with CF tags, I generally go looking for a >> Java >> solution. These pages may have useful snippets... >> http://www.coldfusionmuse.com/index.cfm/2006/10/26/Java.directory.list >> http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html >> http://www.scripts.com/coldfusion-scripts/file-manipulation-scripts/ >> >> On Jan 21, 2008 2:27 PM, Sarah Geren <[EMAIL PROTECTED]> wrote: >> >>> Hello, >>> >>> I have an application which uses CFFILE to read a binary file into a >>> variable, and that variable is used to write out the video to the brower >>> so >>> someone can download it... >>> This code is working great, until the file sizes become too large. It >>> seems to stop working (and returns a null null or 500 null error) when >>> the >>> file sizes go past 200-250MB... >>> There are some files on this server that are up to 1GB in size that have >>> to be downloaded via this script, so it needs to be able to handle >>> pretty >>> big files. >>> >>> The server is MX7, 4GB Ram, and here are my java args: >>> >>> java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS >>> -Xms1024m -Xmx1024m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m >>> -XX:PermSize=64m -Dcoldfusion.rootDir={application.home}/../ - >>
Re: Read large binary file, MX7?
thanks, I was actually originally trying to use this piece of code that I found using java to read through the object, but I am so not a Java person and got stuck when I needed to add the following parameter: response.setContentLength(arrayLen(byte_arry_here)); into the script so that the browser knows how much it is downloading... I tried: response.setContentLength(arrayLen(instream)); response.setContentLength(arrayLen(byteArray)); response.setContentLength(arrayLen(s_file)); but none worked... So I gave up and decided to use cfffile, until realizing how large some of the files were. I just wasn't sure if there was something else I could do with cffile that would make my original code work... So can someone tell me instead how to call the content length into the script below please? function f_Stream(s_file,i_seek,MIME_TYPE,fileName) { var i_position = i_seek; var i_buffer = 1; var byteClass = createObject("java", "java.lang.Byte"); // var byteArray = createObject("java","java.lang.reflect.Array").newInstance(byteClass.TYPE, i_buffer); var context = getPageContext(); var response = context.getResponse().getResponse(); var instream = createObject("java", "java.io.FileInputStream"); var outstream = response.getOutputStream(); // take over control of the feed to the browser if(structKeyexists(arguments,"MIME_TYPE")) response.setContentType(MIME_TYPE); if(structKeyExists(arguments,"fileName")) response.setHeader("content-disposition","attachment; filename=#fileName#"); byteClass.Init(1); instream.init(s_file); context.setFlushOutput(false); try { if(i_seek GT 0) { //instream.skip(i_seek); //outstream.write(toBinary('RkxWAQEJCQ==')); // output the header bytes } do { i_length = instream.read(byteArray,0,i_buffer); if (i_length neq -1) { outstream.write(byteArray); outstream.flush(); } } while (i_length neq -1); // keep going until there's nothing left to read. } catch(any excpt) {} outstream.flush(); // send any remaining bytes response.reset(); // reset the feed to the browser outstream.close(); // close the stream to flash instream.close(); // close the file stream } - Original Message - From: "Sonny Savage" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, January 21, 2008 3:07 PM Subject: Re: Read large binary file, MX7? > Any time I find a bottleneck with CF tags, I generally go looking for a > Java > solution. These pages may have useful snippets... > http://www.coldfusionmuse.com/index.cfm/2006/10/26/Java.directory.list > http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html > http://www.scripts.com/coldfusion-scripts/file-manipulation-scripts/ > > On Jan 21, 2008 2:27 PM, Sarah Geren <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I have an application which uses CFFILE to read a binary file into a >> variable, and that variable is used to write out the video to the brower >> so >> someone can download it... >> This code is working great, until the file sizes become too large. It >> seems to stop working (and returns a null null or 500 null error) when >> the >> file sizes go past 200-250MB... >> There are some files on this server that are up to 1GB in size that have >> to be downloaded via this script, so it needs to be able to handle pretty >> big files. >> >> The server is MX7, 4GB Ram, and here are my java args: >> >> java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS >> -Xms1024m -Xmx1024m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m >> -XX:PermSize=64m -Dcoldfusion.rootDir={application.home}/../ - >> Dcoldfusion.libPath={application.home}/../lib -XX:+UseConcMarkSweepGC >> -XX:+UseParNewGC >> -XX:NewSize=48m -Dcoldfusion.classPath={application.home}/../lib/updates >> ,{application.home}/../lib,{application.home}/../gateway/lib/,{ >> application.home}/../wwwroot/WEB-INF/cfform/jars >> >> Any help would be appreciated! >> Thanks! >> >> >> >> >>context = getPageContext(); >>context.setFlushOutput(false); >>response = context.getResponse().getResponse(); >>out = response.getOutputStream(); >>response.setContentType("video/mpeg"); >>response.setContentLength(arrayLen(video)); >>out.write(video); >>out.flush(); >> response.reset(); >> out.close(); >> >> >> > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297031 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Read large binary file, MX7?
> I have an application which uses CFFILE to read a binary file > into a variable, and that variable is used to write out the > video to the brower so someone can download it... Why are you doing this? You can use CFCONTENT to return a file directly. Alternatively (and generally even better), you can use CF to create a symbolic link to a file (or, on Windows, to the directory containing that file) that wouldn't normally be accessible directly through the web server. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297030 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Read large binary file, MX7?
Any time I find a bottleneck with CF tags, I generally go looking for a Java solution. These pages may have useful snippets... http://www.coldfusionmuse.com/index.cfm/2006/10/26/Java.directory.list http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html http://www.scripts.com/coldfusion-scripts/file-manipulation-scripts/ On Jan 21, 2008 2:27 PM, Sarah Geren <[EMAIL PROTECTED]> wrote: > Hello, > > I have an application which uses CFFILE to read a binary file into a > variable, and that variable is used to write out the video to the brower so > someone can download it... > This code is working great, until the file sizes become too large. It > seems to stop working (and returns a null null or 500 null error) when the > file sizes go past 200-250MB... > There are some files on this server that are up to 1GB in size that have > to be downloaded via this script, so it needs to be able to handle pretty > big files. > > The server is MX7, 4GB Ram, and here are my java args: > > java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS > -Xms1024m -Xmx1024m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m > -XX:PermSize=64m -Dcoldfusion.rootDir={application.home}/../ - > Dcoldfusion.libPath={application.home}/../lib -XX:+UseConcMarkSweepGC > -XX:+UseParNewGC > -XX:NewSize=48m -Dcoldfusion.classPath={application.home}/../lib/updates > ,{application.home}/../lib,{application.home}/../gateway/lib/,{ > application.home}/../wwwroot/WEB-INF/cfform/jars > > Any help would be appreciated! > Thanks! > > > > >context = getPageContext(); >context.setFlushOutput(false); >response = context.getResponse().getResponse(); >out = response.getOutputStream(); >response.setContentType("video/mpeg"); >response.setContentLength(arrayLen(video)); >out.write(video); >out.flush(); > response.reset(); > out.close(); > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297022 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Read large binary file, MX7?
>From http://www.tri-phase.com/data/pdf/coldfusioncookbook41.pdf Does CFFILE have a file size limit? There is no specific limit on file size for CFFILE. However, CFFILE loads the file into the server's memory, so you will get an error if the file size exceeds the amount of free RAM. Also note, you can place a server wide limit on the size of uploads in the CF administrator. Under the "settings" link, see: Maximum size of post data (MB), Request throttle threshold (MB), and Request throttle memory (MB). - Original Message - From: "Sarah Geren" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, January 21, 2008 1:27 PM Subject: Read large binary file, MX7? > Hello, > > I have an application which uses CFFILE to read a binary file into a > variable, and that variable is used to write out the video to the brower > so someone can download it... > This code is working great, until the file sizes become too large. It > seems to stop working (and returns a null null or 500 null error) when the > file sizes go past 200-250MB... > There are some files on this server that are up to 1GB in size that have > to be downloaded via this script, so it needs to be able to handle pretty > big files. > > The server is MX7, 4GB Ram, and here are my java args: > > java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xms1024m > -Xmx1024m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m > -XX:PermSize=64m -Dcoldfusion.rootDir={application.home}/../ > -Dcoldfusion.libPath={application.home}/../lib > -XX:+UseConcMarkSweepGC -XX:+UseParNewGC > -XX:NewSize=48m > -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars > > Any help would be appreciated! > Thanks! > > > > >context = getPageContext(); >context.setFlushOutput(false); >response = context.getResponse().getResponse(); >out = response.getOutputStream(); >response.setContentType("video/mpeg"); >response.setContentLength(arrayLen(video)); >out.write(video); >out.flush(); > response.reset(); > out.close(); > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297021 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Read large binary file, MX7?
Hello, I have an application which uses CFFILE to read a binary file into a variable, and that variable is used to write out the video to the brower so someone can download it... This code is working great, until the file sizes become too large. It seems to stop working (and returns a null null or 500 null error) when the file sizes go past 200-250MB... There are some files on this server that are up to 1GB in size that have to be downloaded via this script, so it needs to be able to handle pretty big files. The server is MX7, 4GB Ram, and here are my java args: java.args=-server -DJINTEGRA_NATIVE_MODE -DJINTEGRA_PREFETCH_ENUMS -Xms1024m -Xmx1024m -Dsun.io.useCanonCaches=false -XX:MaxPermSize=512m -XX:PermSize=64m -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewSize=48m -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{application.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars Any help would be appreciated! Thanks! context = getPageContext(); context.setFlushOutput(false); response = context.getResponse().getResponse(); out = response.getOutputStream(); response.setContentType("video/mpeg"); response.setContentLength(arrayLen(video)); out.write(video); out.flush(); response.reset(); out.close(); ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297011 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Sending a binary file to the browser
Awesome, that works great! I *ALMOST* got it working with less java... #str# Unfortunately, this method doesn't quite work, as applying the charset messes a FEW things up (if I look at the response in Fiddler, they're *ALMOST* identical). But your way works, so I'm pretty happy 'bout that =) Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262492 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Sending a binary file to the browser
This method works for me. I gleaned it from a blog post by Christian Cantrell a while back. context = getPageContext(); context.setFlushOutput(false); response = context.getResponse().getResponse(); out = response.getOutputStream(); response.setContentType("image/png"); response.setContentLength(arrayLen(byteArray)); out.write(byteArray); out.flush(); response.reset(); out.close(); -- Joseph Lamoree ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262485 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sending a binary file to the browser
> If I have the contents of a binary file in memory, is it > necessary to dump those contents to a file in order to send > it to the browser, or can I do something like this: > > >value="attachment; filename=#myImage.name#"> type="#myImage.type#"> #myImage.binaryData# I don't think you can write binary data directly to page output like that. I think you'll have to use the BinaryEncode function (in CF 7) or ToBase64 (in earlier CF versions) on your binary data to write it to the page output. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262483 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sending a binary file to the browser
#myImage.binaryData# I believe you can do this, but you have to be very diligent to remove all extraneous white space, as it will be included in the "binary" data and throw it off. Make liberal use of tags and make sure there is not extra space between the tag and the output data. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - "C code. C code run. Run code run. Please!" - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262478 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Sending a binary file to the browser
If I have the contents of a binary file in memory, is it necessary to dump those contents to a file in order to send it to the browser, or can I do something like this: #myImage.binaryData# Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:262477 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Upload binary file and insert into Oracle
> > Simple. The old and the new app need to be able to run in parallel until we > completely retire the old app, which should be ~90 days after release. I > rebuilt an app that took 2 people 7 months to build; I did it alone and in > two months (not by choice, but because I had sharp, heavy objects being > thrown in my general direction). This is a mission-critical app and we want > to make sure that all is well with the new app before we put the old one out > to pasture. > > And, yes, it IS an awful lot like flying by the seat of ones' pants. > No... Sounds like very good practice to me. Flying by the seat of your pant would be switching the old app off with out an overlap. ;o) And now it really occurs to me why you need the files in the database.. Because you need both apps running in parallel for 90 days and if the new app doesn't write the files into the database and if it goes wrong you "lose" a lot of the data/files that were entered, plus anything added to the database by the new app won't be visible to the old app. Going back to what you asked about CFQUERYPARAM. > Using CFQUERYPARAM, do I need to use CFFILE to get the file onto the server? > Or do I just use CFQUERYPARAM with the name of the file upload field as the > variable? > I confess that I've never done this before (being a anti-DB-as-a-file-store fanatic), but I believe you should just be able to give the form variable containing your file to cfqueryparam as the value with the appropriate cfsqltype. Having had a look though, it doesn't appear that there is a BLOB type for cfqueryparam. I think you need to look at the IsBinary/IsBase64 and ToBinary/ToBase64 functions to be able to make sure that the data is in the right format when you insert it. If I remember correctly, files in form data are in base64, so you'd do INSERT INTO BlobField VALUES #ToBinary(form.filefield)# Hope this helps get you closer to your goal. Regards Stephen ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Upload binary file and insert into Oracle
- Original Message - From: "Stephen Moretti" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 10:03 AM Subject: Re: Upload binary file and insert into Oracle > > Ok. Now I've read it and not being funny, but why bother? Simple. The old and the new app need to be able to run in parallel until we completely retire the old app, which should be ~90 days after release. I rebuilt an app that took 2 people 7 months to build; I did it alone and in two months (not by choice, but because I had sharp, heavy objects being thrown in my general direction). This is a mission-critical app and we want to make sure that all is well with the new app before we put the old one out to pasture. And, yes, it IS an awful lot like flying by the seat of ones' pants. Pete ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Upload binary file and insert into Oracle
Pete, > Not to be rude, but...please reread sentence 2 of paragraph 1 of my original > post. Believe me, the goal IS to get the files onto the file system, but > it's not going to happen with this release of the app that I'm building. > Opps... Apologies Don't know how I missed that one sentence Read all the rest about re-building an icky PL/SQL application, but totally missed that one sentence... Ok. Now I've read it and not being funny, but why bother? Theoretically, there should only be a couple of occassions when you will be accessing the file. One is when a user uploads a file to the server and the other is when a user downloads it. Rather than mess on trying to push and pull the files out of the database, why not replace those bits of code with some very simple code that pulls and pushes the files from the appropriate places on the app server??? Its probably costing you more in time to try and exactly replicate the application code, when you could replace now some of the bits that you know you're going to change later. Regards Stephen ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Upload binary file and insert into Oracle
Not to be rude, but...please reread sentence 2 of paragraph 1 of my original post. Believe me, the goal IS to get the files onto the file system, but it's not going to happen with this release of the app that I'm building. Pete - Original Message - From: "Stephen Moretti" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 9:22 AM Subject: Re: Upload binary file and insert into Oracle > I have to ask, why bother? > > You've already got the file onto your app server's filing system, just add a > reference to the file in the DB. > Why bother adding another stage to the process of uploading the file? > Why add it to the database, when databases were never intended as file > storage devices? > Why bloat your database with binaries needlessly? > > Just my feelings on storing files in databases. Feel free to ignore me. > > Regards > > Stephen > > - Original Message - > From: "Pete Ruckelshaus" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Monday, February 03, 2003 1:59 PM > Subject: Upload binary file and insert into Oracle > > > > I've never inserted files into a database before, so I just want to ask > some questions. Also, please don't respond with "Just store the files on > the server's file system and not in the database"...I'm rebuilding an > existing app and this is the way it works. > > > > I have an interface where a user will select and upload a binary file; > this file will then be stored in an Oracle 8.0.4 database. All of the stuff > on the database side of things are set up since it's a working app now > (written in PL/SQL, being rewritten by me in CF5). > > > > Here is what I assume the steps will be: > > > > * User selects file in form. > > * Upon submission, use CFFILE to save the file to the app server's file > system. > > * Do a SQL INSERT to insert the binary file into the database...but how? > > > > It's the last step that eludes me. What do I do? > > > > Thanks > > > > Pete > > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Upload binary file and insert into Oracle
I have to ask, why bother? You've already got the file onto your app server's filing system, just add a reference to the file in the DB. Why bother adding another stage to the process of uploading the file? Why add it to the database, when databases were never intended as file storage devices? Why bloat your database with binaries needlessly? Just my feelings on storing files in databases. Feel free to ignore me. Regards Stephen - Original Message - From: "Pete Ruckelshaus" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 1:59 PM Subject: Upload binary file and insert into Oracle > I've never inserted files into a database before, so I just want to ask some questions. Also, please don't respond with "Just store the files on the server's file system and not in the database"...I'm rebuilding an existing app and this is the way it works. > > I have an interface where a user will select and upload a binary file; this file will then be stored in an Oracle 8.0.4 database. All of the stuff on the database side of things are set up since it's a working app now (written in PL/SQL, being rewritten by me in CF5). > > Here is what I assume the steps will be: > > * User selects file in form. > * Upon submission, use CFFILE to save the file to the app server's file system. > * Do a SQL INSERT to insert the binary file into the database...but how? > > It's the last step that eludes me. What do I do? > > Thanks > > Pete > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Upload binary file and insert into Oracle
Using CFQUERYPARAM, do I need to use CFFILE to get the file onto the server? Or do I just use CFQUERYPARAM with the name of the file upload field as the variable? Thanks! Pete - Original Message - From: "Jesse Houwing" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 9:01 AM Subject: Re: Upload binary file and insert into Oracle > Pete Ruckelshaus wrote: > > >I've never inserted files into a database before, so I just want to ask some questions. Also, please don't respond with "Just store the files on the server's file system and not in the database"...I'm rebuilding an existing app and this is the way it works. > > > >I have an interface where a user will select and upload a binary file; this file will then be stored in an Oracle 8.0.4 database. All of the stuff on the database side of things are set up since it's a working app now (written in PL/SQL, being rewritten by me in CF5). > > > >Here is what I assume the steps will be: > > > >* User selects file in form. > >* Upon submission, use CFFILE to save the file to the app server's file system. > >* Do a SQL INSERT to insert the binary file into the database...but how? > > > >It's the last step that eludes me. What do I do? > > > > > use a cfqueryparam to do the job. > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Upload binary file and insert into Oracle
Pete Ruckelshaus wrote: >I've never inserted files into a database before, so I just want to ask some >questions. Also, please don't respond with "Just store the files on the server's >file system and not in the database"...I'm rebuilding an existing app and this is the >way it works. > >I have an interface where a user will select and upload a binary file; this file will >then be stored in an Oracle 8.0.4 database. All of the stuff on the database side of >things are set up since it's a working app now (written in PL/SQL, being rewritten by >me in CF5). > >Here is what I assume the steps will be: > >* User selects file in form. >* Upon submission, use CFFILE to save the file to the app server's file system. >* Do a SQL INSERT to insert the binary file into the database...but how? > >It's the last step that eludes me. What do I do? > > use a cfqueryparam to do the job. ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Upload binary file and insert into Oracle
I've never inserted files into a database before, so I just want to ask some questions. Also, please don't respond with "Just store the files on the server's file system and not in the database"...I'm rebuilding an existing app and this is the way it works. I have an interface where a user will select and upload a binary file; this file will then be stored in an Oracle 8.0.4 database. All of the stuff on the database side of things are set up since it's a working app now (written in PL/SQL, being rewritten by me in CF5). Here is what I assume the steps will be: * User selects file in form. * Upon submission, use CFFILE to save the file to the app server's file system. * Do a SQL INSERT to insert the binary file into the database...but how? It's the last step that eludes me. What do I do? Thanks Pete ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Microsoft Binary File Format
I think there is a filter for 'tidy' to clean up the MS Word HTML-hell to standards-compliant (XHTML?). __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Microsoft Binary File Format
The only thing I could do was install Office on the server and use com object to convert it to html. It makes it into Microsoft safe HTML, so don't even think of letting other browsers see it. It will change all the pictures to png, comes out pretty functional, looks pretty much like the old text. Robert Everland III Web Developer Extraordinaire Dixon Ticonderoga Company http://www.dixonusa.com -Original Message- From: Winn, Ron [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 10:52 AM To: CF-Talk Subject: Microsoft Binary File Format Does anyone know where to get the Microsoft binary file format converter for Word? I sent an email to [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> and in typical Microsoft fashion, they are slow. I am converting pieces of word documents for storage into a SQL database. The text has to preserver formatting and tables, otherwise I would store it as regular text. Ronald Winn Application Development Manager Cingular Wireless 678.418.4402.Voice 404.216.5205.Cell [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> When you follow your faith... doors will open where you would not have thought there would be doors; and where there wouldn't be a door for anyone else. __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Microsoft Binary File Format
Does anyone know where to get the Microsoft binary file format converter for Word? I sent an email to [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> and in typical Microsoft fashion, they are slow. I am converting pieces of word documents for storage into a SQL database. The text has to preserver formatting and tables, otherwise I would store it as regular text. Ronald Winn Application Development Manager Cingular Wireless 678.418.4402.Voice 404.216.5205.Cell [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> When you follow your faith... doors will open where you would not have thought there would be doors; and where there wouldn't be a door for anyone else. __ Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Question about Inserting into SQL via CF... Binary file or Image File
There are two custom tags available to do this (cfx_putimage and cfx_getimage) - downloaded together in a .zip file (I think I got it off of cf-dev) that does exactly that. It's done through BLOBs. We used it for a while and then went away from it because someone here, that's a better SQL person than me, suggested that it was a bad idea. We've since gone back to just storing the location of the file in the DB. Mark -Original Message- From: Kelly Matthews [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 3:03 PM To: CF-Talk Subject: Question about Inserting into SQL via CF... Binary file or Image File As most of you know SQL has a datatype of Binary that can hold an actual binary file and has a datatype of image that can hold an image file. I sent this question yesterday but go no response figured I would try once more. Obviously I know how to insert DATA via CF into SQL. But w/ in that insert statement does anyone know how to insert a binary file or an image file into a SQL database, using a CF/SQL insert statement? Any help would be most appreciated. :) Kelly ~~ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Question about Inserting into SQL via CF... Binary file or Image File
As most of you know SQL has a datatype of Binary that can hold an actual binary file and has a datatype of image that can hold an image file. I sent this question yesterday but go no response figured I would try once more. Obviously I know how to insert DATA via CF into SQL. But w/ in that insert statement does anyone know how to insert a binary file or an image file into a SQL database, using a CF/SQL insert statement? Any help would be most appreciated. :) Kelly ~~ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Writing 0 to a binary file.
Hi there, The quick: I'm trying to write out binary files, i.e. just a whole bunch of numbers, what's the best way of doing this. The slightly longer: I'm trying to write out a binary file, that can contains the value 0, and it doesn't seem possible (in any simple, fast way). Here's the background. I'm trying to read in and write out .wbmp graphic files. I can read in a file with the following snippit... #asc(mid(inputFile,thisPos,1))# - #ucase(formatBaseN(asc(mid(inputFile,thisPos,1)),16)# - #mid(inputFile,thisPos,1)# which may give me the results: 0 - 0 - 0 - 0 - 92 - 5C - \ 65 - 41 - A 0 - 0 - 77 - 4D - M 116 - 74 - t 0 - 0 - 0 - 0 - --- Now I want to write these results back to a file, normally I'd do something like (which I'm sure is a very wrong way of doing it)... However reading that back in just gives me; 92 - 5C - \ 65 - 41 - A 77 - 4D - M 116 - 74 - t It's lost the 0's chr(0) = null, which may explain the problem. --- I *can* do it with the following... The above give me what I want, but with loads of disk accessing, basically I just want to speed it all up! Thanks for any help, Dan. This message is intended only for the use of the person(s) ("the intended recipient(s)") to whom it is addressed. It may contain information which is privileged and confidential within the meaning of the applicable law. If you are not the intended recipient, please contact the sender as soon as possible. The views expressed in this communication may not necessarily be the views held by Live Information Systems Limited. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists