Re: Running Command line stuff...
Not sure what version of CF you're using, but have a look at the cfexecute tag. It can do what you need. On 2 January 2015 at 15:15, Les Irvin les.cft...@gmail.com wrote: I've searched and found a dozen ways to run a command line application via ColdFusion, none of which seem to work. Can anyone show me the right way? I want to run a program called ffmpeg.exe from the command line. The code I need to execute is something like this: ffmpeg -i input.jpg -vf scale=iw*min(1200/iw\,800/ih):ih*min(1200/iw\,800/ih),pad=1200:800:(1200-iw)/2:(800-ih)/2 img010.jpg How can I do this within CF? Thanks in advance for any help! Les ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359900 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Adding n characters to a string
I think you're looking for repeatString(string, count). On 25 September 2014 13:54, Mike K afpwebwo...@gmail.com wrote: I'm having a brain fade - I know I've done this before but for the life of me I can't find where it was.I hope someone can help me out here before i go crazy ... I need to add (n) hard spaces (nbsp;) before a string, so it indents the string a variable amount depending on its level in a hierarchy. I know I've done something like multiply a character by a variable but I'm damned if i can remember how. I tried #(n * nbsp;)# but it doesnt work. You can't convert a character to a number to multiply it. So how do I add (n) spaces to a string? -- Cheers Mike Kear Windsor, NSW, Australia Adobe Certified Advanced ColdFusion Developer AFP Webworks http://afpwebworks.com ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359357 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Querying a comma separated list
I'm pretty certain you can't do what you're trying to do directly. The comma delimited list you have stored in gtype is just a string as far as the DB engine is concerned and cannot be searched as a list. If you must store it this way, I have achieved the result I think you want, in the past, with the following somewhat ugly query: cfquery name=getslides datasource=#dsn# select* from pgallery wheregtype LIKE '1' OR gtype LIKE '1,%' OR gtype LIKE '%,1' OR gtype LIKE '%,1,%' /cfquery Basically this manually searches the string for the four possible positions for your target element in a comma delimited list: 1. Element is the only thing in the list 2. Element begins the list 3. Element ends the list 4. Element is in the list between two other elements Hope that helps. Also I'm basing this on my experience with MS-SQL so apologies if MS-ACCESS actually does provide a way to do this natively. On 27 August 2014 10:32, Jon Clausen jon_clau...@silowebworks.com wrote: listContains() isnât a function of the database but, rather, a CFML function. If youâre storing the list as a string list, and are querying the database, then your query will have to use Access string functions as it doesnât know CFML: http://www.techonthenet.com/access/functions/ HTH, Jon On Aug 26, 2014, at 8:13 PM, te...@it-werks.com te...@it-werks.com te...@it-werks.com wrote: I haven't done this is ages and could use some help, please. Here I define a list of checkboxes of picture types: input type=checkbox name=tt value=1 cfif gtype contains '1'checked/cfifSolidbr input type=checkbox name=tt value=2 cfif gtype contains '2'checked/cfifOpenbr input type=checkbox name=tt value=3 cfif gtype contains '3'checked/cfifInsulatedbr input type=checkbox name=tt value=4 cfif gtype contains '4'checked/cfifCombinationbr At form submit I update the record: cfquery name=upcontent datasource=#dsn# maxrows=1 update pgallery set gtype = '#tt#' where id = #picid# /cfquery Now here's where I screw up: cfquery name=getslides datasource=#dsn# select * from pgallery where listContains(gtype, 1) /cfquery Here;s the error: Error Executing Database Query. [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Undefined function 'listContains' in expression. Terry ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359197 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: too many scheduled tasks in the CF-backend
Yep. With a combination of cfschedule and a Java serviceFactory. You can retrieve a list of all scheduled tasks using the Java object then loop over it to delete based on whatever condition you like. You get back an array of structs where the name of each task is contained in the key Task. I'm basing this mostly on this link: http://stackoverflow.com/questions/2320396/how-to-get-list-of-scheduled-tasks-and-last-run-results-in-coldfusion This example would delete everything: cfset factory = createObject(java, coldfusion.server.ServiceFactory) cfset allTasks = factory.CronService.listAll()/ cfloop index=i from=1 to=#ArrayLen(allTasks)# cfschedule action=delete task=#allTasks[i].task# /cfloop On 23 December 2013 09:49, Uwe Degenhardt cf-t...@sdsolutions.de wrote: Hi list ! I have a strange problem. A customer of mine has programmed a cf-page with cfschedule years ago. And now I have seen, that there are thousands of test-entries in the scheduler. I want to clear now programmatically the neo-cron.xml, since I don't want to delete approximately 3000-4000 scheduled tasks manually in the CF backend. :-( Any ideas how to do this ? We run CF 8 on Windows. Uwe P.S.: This message is a resend of my message from 12/17/2013 that obviously never got posted. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357376 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: ColdFusion 10 - Web Service Proxy User Domain
Use the other form of the domain username: usern...@domain.com That should work. On 9 March 2013 09:23, Bill Franklin bill.frank...@bayer.com wrote: I am trying to setup a webservice in CF Administrator. I get everything setup but when I try to specify the required domain with the username, it appears to break it...any help would be appreciated. For instance, I setup domain\username...it removes the \ and sets it to domainusername, which doesn't work. If I setup the domain\username in the cfinvoke proxyUser parameter, it works just fine. TIA ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354907 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Hack - Further Information
Great explanation Dave. Good to know. On 5 February 2013 11:21, Dave Watts dwa...@figleaf.com wrote: OK, now that you've done that: CF serves all sorts of pages that don't exist. You may read up in this very thread about CFCHART, which relies on a URL pattern that doesn't exist. CF relies on servlet mappings, which may or may not correspond with actual URLs. Typically, they do, but there are some specific URL mappings that are created by default when you install CF, and one of them is /CFIDE/Administrator/index.cfm. Another is /CFIDE/Main/ide.cfm - this is another file that doesn't even exist by default. I understand that under special circumstances like CFChart it serves pages that don't exist. But in the scenario I outlined where CFIDE mappings have been re-pointed to a folder that does not carry the administrator folders and the web server provides a Virtual directory to the very same duplicated CFIDE folder, I fail to see how it would ever serve the content from the administrator and adminapi folders... In a nutshell: - client requests /CFIDE/Administrator/index.cfm - request is immediately passed to CF by the web server - this happens before the web server tests for the existence of a file at that URL - CF looks at its list of servlet mappings, and finds one for /CFIDE/Administrator/index.cfm - CF looks on the filesystem for where it expects to find this file, based on where these files were placed during the initial install - if the file is there, it's executed So, let's say you install CF without hooking it up to a web server, then later hook it up to IIS. In that case, CF will initially use the built-in web server, and create the file c:\coldfusion9\wwwroot\CFIDE\Administrator\index.cfm. When you hook up the web server, the web root might be c:\inetpub\wwwroot, and you may have created your own CFIDE directory there without the Administrator subdirectory, so that the directory c:\inetpub\wwwroot\CFIDE exists but the file c:\inetpub\wwwroot\CFIDE\Administrator\index.cfm does not. Nevertheless, CF will execute the file c:\coldfusion9\wwwroot\CFIDE\Administrator\index.cfm when you ask it for http://your_IIS_web_server/CFIDE/Administrator/index.cfm even though a request for http://your_IIS_web_server/CFIDE/Administrator/ returns a 404 - the second URL doesn't match an explicit servlet mapping. Alternatively, let's say you install CF and hook it up to your default IIS server. In that case, CF will create the file c:\inetpub\wwwroot\CFIDE\Administrator\index.cfm. Then, you might create a new IIS virtual server, and set its web root to c:\inetpub\otherserver\. You'd still have the same problem, as CF would still be able to resolve to the original location of the file. We actually go through this in our Administering ColdFusion 9 course as it's a fairly common configuration mistake. http://training.figleaf.com/courses/administering_coldfusion.cfm Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354296 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Difficulty in creating a dynamic query
Ditto Steve's question. You're trying to use cfqueryparam outside of a cfquery block. Coldfusion is just going to see #sqlStatement# as a block of literal text, so it will pass WHERE firstName LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%bar% / into the DB exactly as written. And SQL will complain of course. You can successfully build dynamic queries if you do it within the cfquery block, like: cfquery SELECT otherID FROM thirdTable WHERE firstName LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%bar% / cfif someCondition OR lastName LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%bar% / /cfif /cfquery -- Bill. On 23 January 2013 07:57, Steve Milburn scmilb...@gmail.com wrote: If you just output the sqlStatement variable, how does it look? Also, any particular reason you are not just building your sql statement inside the cfquery tags? On Tue, Jan 22, 2013 at 3:33 PM, Tom McNeer tmcn...@gmail.com wrote: Hi, I need to build up a complex dynamic query statement. I have built methods to add queryParam statements, and built up valid SQL. If I do: cfset sqlStatement = SELECT DISTINCT tableName.ID FROM tableName LEFT OUTER JOIN secondTable ON tableName.ID=secondTable.fkID WHERE ( tableName.clientID = 'D35DAF11-DCB2-4341-B26C-0D31325CD51B' AND tableName.otherID IN (SELECT otherID FROM thirdTable WHERE (firstName LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%bar% / OR lastName LIKE cfqueryparam cfsqltype=cf_sql_varchar value=%bar% /)) ) / And then do: cfquery name=foo #sqlStatement# /cfquery I get an error from the SQL Server driver that points to the first part of the client ID - Incorrect syntax near 'D35DAF11' and a nextException that says Incorrect syntax near ''. Yet if I paste the above statement directly into the cfquery tag, it runs perfectly. Can anyone suggest where I'm going wrong, please? I suppose it could be a single quotes problem of some sort. But certainly preserveSingleQuotes has no affect. And if I wrap the first varchar (the clientID) in a queryParam statement, it simply eliminates the first error and immediately shows the Incorrect syntax near ''. error. -- Thanks, Tom Tom McNeer MediumCool http://www.mediumcool.com 1735 Johnson Road NE Atlanta, GA 30306 404.589.0560 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:354010 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfimage error
Just because I ran into this CFimage problem yesterday... Are the images by any change named with the wrong extension? For example, a PNG inmage mistakenly named with a JPG extension? If you examine the first bit of the file in a hex editor, you can see the difference. Cheers. On 16 January 2013 08:57, Tim Do t...@wng.com wrote: All images are RGB/BW no CMYK. -Original Message- From: Robert Harrison [mailto:rob...@austin-williams.com] Sent: Tuesday, January 15, 2013 1:48 PM To: cf-talk Subject: RE: cfimage error Is the image CYMK? That could cause a problem. Robert Harrison Director of Interactive Services Austin Williams Advertising I Branding I Digital I Direct 125 Kennedy Drive, Suite 100 I Hauppauge, NY 11788 T 631.231.6600 X 119 F 631.434.7022 http://www.austin-williams.com Blog: http://www.austin-williams.com/blog Twitter: http://www.twitter.com/austin_williams -Original Message- From: Tim Do [mailto:t...@wng.com] Sent: Tuesday, January 15, 2013 2:34 PM To: cf-talk Subject: cfimage error I have this bit of code that used to work in the past... but now I'm getting: An exception occurred while trying to read the image. javax.imageio.IIOException: Can't get input stream from URL! I verified that the image is still there and permissions are still the same. I'm able to display the image fine. We're on cf9. cfimage source=#getImage.imgName# action=info structName=FlrPlnInfo I'm just trying to get the width of the image. So I tried to use code below but just getting -1 for width and height. cfobject type=JAVA action=Create name=tk class=java.awt.Toolkit /cfobject cfobject type=JAVA action=Create name=img class=java.awt.Image /cfobject cfscript img = tk.getDefaultToolkit().getImage(#getImage.imgName#); width = img.getWidth(); height = img.getHeight(); /cfscript cfoutput#width#br /#height#/cfoutput Thanks! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353906 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where is information used by the Scheduler?
By any chance is your JVM running in a different locale than your system local? I ask because I had a similar issue. My system runs in Australia, but I happened to be in Canada (with my system temporarily set to american standards) when I installed a new version of Java. The install picked up the north american settings and as a result I kept getting weird invalid date issues when I got back to Aus. Took a while to figure out that's what was happening. I eventually fixed the problem by forcing a locale fro the JVM in the ColdFusion Administrator by adding the following JVM arguments: -Duser.language=en -Duser.country=AU. Hope that helps. Cheers, Bill. On 27 November 2012 07:46, wrote: I notice that this invalid date is in american format (mm/dd/), though My system local is set for French, thus the date format should be dd/mm/ I think I will have to wait until dec 1st, the the date will be valid in both formats, and hopefuly I'll see where it is used. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353293 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Where is information used by the Scheduler?
You're very welcome. Glad to help. :) On 27 November 2012 09:24, wrote: I eventually fixed the problem by forcing a locale fro the JVM in the ColdFusion Administrator by adding the following JVM arguments: -Duser.language=en -Duser.country=AU. Hey! How about that! It solved my problem. I added -Duser.language=fr -Duser.country=CA and now it works. Thanks a lot! ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353298 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm