Re: web service image upload issue
Peter, I am noticing you are using fileRead to read the file into memory and then convert it to base 64 and then to binary. Why not use cffile action=readbinary to avoid jumping through all the hoops to start? Plus I am thinking that it is likely that using fileread to start and cffile to write might cause some issue. I have no resource that I can point to that says it will cause a problem, but I would just stick with one or the other. HTH, Will > I am working on a remote call cfc that will allow remote user to > upload an image file. Should be pretty straight forward but I am > finding that the image being saved is not quite right and therefore > NFG. > > The remote call from my test cfm page is as follows... > > > > > > > > > returnvariable="results" > webservice="http://localdemo/billclix/billclix04.cfc?wsdl";> >name="buildID" value="PetersTestPage01">name="email" value="new...@testing.com">value="pass123"> value="#binaryData#"> > > My simplified code on the cfc page is as follows... > > > returntype="string" > > default=""> > > > > > > > >output="#ToBinary( ToBase64( arguments.imageToUpload ))#" > nameconflict="OVERWRITE" /> > > > Image Upload Done > > > > > As I said the saved image is NFG, when I open the image file in > notepad and compare it to the original the source is 99.9% identical > does anyone have any thoughts on why it is not 100% identical? ~| 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:345108 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Can anyone decode this?
I know this is a few days old, but just curious the OP says this attack was caught by some custom code. Will cfqueryparam not protect input sufficiently enough to disrupt this kind of attack? Should additional measures be used? Thanks, Will >Bobby, > >Good work... except don't respond and include the actual URL - or if you do >find a way to disable it. It will show up in email readers as a link and (in >this case) it will end up published on the HOF archive page for this thread. >We don't want to give this malicious site any additional traffic :) > >-Mark > >Mark A. Kruger, MCSE, CFG >(402) 408-3733 ext 105 >www.cfwebtools.com >www.coldfusionmuse.com >www.necfug.com > > ~| 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:344565 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF Query to WDDX to Javascript. Possible?
Cameron, Agreed. We do have CF 9 we just have not installed it yet. I am not 100% sure what is taking so long to get it done, but that is a decision that much higher up in the food chain than I am. I'll check out CFLib.org and see what I can find. Thanks for the info. Will >> OK, first not sure why there are two threads going about this question > >Probably something about the HOF email/BB interface splitting it up. > >> I currently on CF 6.1 so I (should?) be able to get a JSON response, I will >> take a look at that route. I do not have a lot of experience doing this type >> of thing so I am pretty sure there is a better way to go than I am currently >> going, and if JSON is it I am open to it. > >If possible, I would seriously considering moving up to the current >version of CF (CF9). If that's not possible, you're going to continue >running into problems with functionality that you'd really REALLY love >to have, but you don't. Often the cost of upgrade is cheaper than >whatever hourly rate you apply to recreating features that are >included in CF9 for you right out of the box. > >Having said that I don't think JSON formatted output from CFCs was >introduced till CF8. > >However, JSON is just another way to format output. You can easily >build your own JSON strings from objects. If you search cflib.org you >might even find some stuff there that works with CF6.1. Again though, >the time you will spend trying top rebuild features that are "just >there" in CF9 can be high. > >-Cameron > >-- >Cameron Childress >Sumo Consulting Inc >http://www.sumoc.com >--- >cell: 678.637.5072 >aim: cameroncf >email: camer...@gmail.com ~| 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:335541 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF Query to WDDX to Javascript. Possible?
OK, first not sure why there are two threads going about this question... Anyway, to address some of the comments: I currently on CF 6.1 so I (should?) be able to get a JSON response, I will take a look at that route. I do not have a lot of experience doing this type of thing so I am pretty sure there is a better way to go than I am currently going, and if JSON is it I am open to it. >> No, WDDX is XML, not Javascript; it always has been. > >The WDDX SDK actually shipped with a fairly robust (for the time) set >of JS libraries for manipulating WDDX data via JavaScript. > >Looks like the official home(s) for the WDDX SDK (wddx.org, then >openwddx.org) went away some times ago, but you can still find the >original docs hosted elsewhere via google (ie: >http://www.finwin.com/Dev/wddxsdk/). There is also some JS >documentation in the official CF docs at Adobe.com (do a search). > >However, I would echo the suggestion that you look into JSON and some >of the JSON parsers for better forward compatibility. WDDX had it's >day in the sun, and it's still valid and useful, but JSON is going to >take you farther with more available tools and a brighter future. > >-Cameron > >-- >Cameron Childress >Sumo Consulting Inc >http://www.sumoc.com >--- >cell: 678.637.5072 >aim: cameroncf >email: camer...@gmail.com ~| 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:335535 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF Query to WDDX to Javascript. Possible?
> It's been a long time since I've done this so this may not be useful, > but isn't the returned packet a Javascript array? At least it was > when I used to use cfwddx, so it was just a matter of normal array > manipulation. Thanks for the response! You would think so, but from my experience I cannot get at the data the same way I would with a normal array. For example: "response.SCNDRY_TXT[1]" returns undefined when I try to 'alert' the value, where response is the name of the total data set, and SCNDRY_TXT is the field name. ~| 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:335521 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CF Query to WDDX to Javascript. Possible?
Hello all, I have a select menu that I need to be dynamically populated with the results of a db query. I am using jQuery/ajax to pass a value to search for in the database. This all seems to work fine except what is returned is a WDDX packet and I cannot figure out how to take the data that is returned and put it in the dynamic select menu. I know CF has a de-serializier but, as this is done at run time on the client machine I do not see how that would help. I know jQuery/JS you can use the eval() function to parse the wddx packet, but the data that comes out looks the same as the data going in. How do I navigate the wddx packet? I have tried what would make sense (i.e. data.fieldName.value)but what JavaScript shows me is blank or undefined. Thanks! Here is a copy of the packet: 4.0 5.0 6.0 ARL Special Dispatch APG Special Dispatch ARL - APG Dispatch ~| 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:335513 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFLOOP inside a CFQuery
WOW! Thanks for all the feedback! One question about CFQUERYPARAM, I use this when I accept anything that is available to the general public, but is it necessary to use this when the form is only accessible via username/password? Is there ever a reason not to use CFQUERYPARAM? Thanks everyone! >You don't need evaluate for dynamically created form variables, in almost >all cases the struct syntax #form['type'&idx]# will suffice and is more >efficient. For this particular scenario, evaluate is an unnecessary overhead >and should be avoided. > > > > INSERT INTO tbl_ballotOrder ( > type, > number, > issue > ) VALUES ( > cfsqltype="cf_sql_varchar" />, > cfsqltype="cf_sql_integer" />, > cfsqltype="cf_sql_varchar" /> > ) > > > > >May I also point out the use of CFQUERYPARAM. It's basic principles; unless >you've got a damn fine reason not to, always use cfqueryparam. Protect >yourself from SQL injection attacks, make your life easier. > >No offence intended, but Will I urge you to ignore the 'evaluate' based >advice. > >Cheers, >Gabriel > >I agree with NK pay attention to the evaluate function. It works like a >charm for dynamically created form variables. I use it often. :) >-- >Ryan LeTulle > > > > >part). ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323310 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFLOOP inside a CFQuery[RESOLVED]
>Check the following link might help... >http://tutorial431.easycfm.com/ > Thank you! I was thinking I had to do something like this to get it to work. I just did not know exactly what it was I needed to do so searching for it was difficult. Thanks again! Will ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323300 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
CFLOOP inside a CFQuery
Hello all, I have a dynamically generated form that I need to figure out how to get the data from that form in to our database. Here is the way it works. First the client types in the number of machines they have and the form generates the correct number of rows so that the info about each machine is located on a separate row. That all works well until they hit submit (or will hit submit if I figure out the next part). How do I create a cfquery that has the correct number of values so that each machines data is stored correctly? For example I will have row one with lets say three fields (Type, number, issue). Lets say a client has a problem with 10 machines. The form now has 10 rows with 3 columns in each. Each field in row one is named type1, number1, issue1 and row two is type2, number2, issue2, etc.. The number next to the name is placed there by putting the index of the loop in the name field. So this is where I was going to use a CFLOOP inside a CFquery to create field names dynamically. I can get it to repeate the information correctly, however the problem is the index of the loop does not seem to get attached to the form value I am putting into the database. I am doing something like: INSERT into tbl_ballotOrder (type, number, issue) Values ( '#FORM.type##LoopCount#', '#FORM.number##LoopCount#', '#FORM.issue##LoopCount#' ) ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323298 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFFTP connection problems
>Will, > >Ah... Your problem could be networking. On our network (for example) we have >both "internal" and "external" IP addresses running through cisco pix. We >have to run an "internal" DNS server to dole out interal IP addresses for >the reason you describe below. A web server could not (for example) connect >to it's "external" address through the same pix. To troubleshoot this, RDP >to the server and then ping the address (the host you are using ... >Remote.myserver.com etc) and see what IP is returned. Check with your >networking folks on how the server is set up. You will have to log on to the >server desktop to be able to troubleshoot effectively. Nothing you do from >your workstation to the server will give you sufficient information. > >-Mark > > > >Mark A. Kruger, CFG, MCSE >(402) 408-3733 ext 105 >www.cfwebtools.com >www.coldfusionmuse.com >www.necfug.com > > >I can telnet from my computer (client) to the coldfusion webserver if I type >"telnet myserver.com 21". Typing remote.myserver.com 21 I get a connection >refused error. Just to make sure we are all clear. The coldfusion server >is our webserver. So when I test the cfftp action="open" technically it is >trying to open an ftp connection to the same server it is on, which I can >see that would be a problem. > >If not using ftp, how would I move a file from my computer to the coldfusion >server? Mark (and everyone else), Thanks for the help but I figured it out. My problem with my CFFTP was because of a networking problem. I was connecting to the wrong IP address... duh! Anyway after all that work trying to figure it out, I found out that what I really needed to use was a simple CFFILE tag. Yes I know this allows anyone to upload to the server, but access to this feature of the application is behind user authentication. Anyway, I really appreciate all the help and suggestions. Thanks again. Will ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319778 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFFTP connection problems
>Can you telnet from the coldfusion to the remote host? > >telnet remote.myserver.com 21 > >If you get something like this: >Escape character is '^]'. >220 (vsFTPd 2.0.1) > >Then there is nothing blocking communication to the remote FTP server. That >way, you can remove that from the list of problems, and check your CFFTP >configuration. > >speeves > I can telnet from my computer (client) to the coldfusion webserver if I type "telnet myserver.com 21". Typing remote.myserver.com 21 I get a connection refused error. Just to make sure we are all clear. The coldfusion server is our webserver. So when I test the cfftp action="open" technically it is trying to open an ftp connection to the same server it is on, which I can see that would be a problem. If not using ftp, how would I move a file from my computer to the coldfusion server? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319715 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFFTP connection problems
> Hello All, > I am sure this is something simple, but I am attempting to use CFFTP > to put a file on our web server. I can access this web server using > any FTP software I want (i.e. Core FTP) but when I try to connect > using CFFTP I get an error stating the connection has timed out. To > be exact: "Error: Connection timed out: connect. > > Verify your connection attributes: username, password, server, port, > connection, proxyServer, secure (as applicable). " > > Figuring it was something that I was doing wrong I went to adobe and > used their FTP test code (basically it connects, reports status, > disconnects, etc..). Same error. > > Something is blocking the CFFTP but I am not sure what or how. I know > the server has a firewall protecting it, but ftp is allowed to pass > through. Other ideas? Server options that I might have turned off or > coldfusion admin options I need to turn on? UPDATE: I have been able to use CFFTP to connect to ftp.mozilla.org. Here is the file that I used: Did the connection close successfully? #cfftp.succeeded# So the question is now, what is stopping my FTP connection to webserver? Again, using FTP software it works, but using CFFTP it does not. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319692 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
CFFTP connection problems
Hello All, I am sure this is something simple, but I am attempting to use CFFTP to put a file on our web server. I can access this web server using any FTP software I want (i.e. Core FTP) but when I try to connect using CFFTP I get an error stating the connection has timed out. To be exact: "Error: Connection timed out: connect. Verify your connection attributes: username, password, server, port, connection, proxyServer, secure (as applicable). " Figuring it was something that I was doing wrong I went to adobe and used their FTP test code (basically it connects, reports status, disconnects, etc..). Same error. Something is blocking the CFFTP but I am not sure what or how. I know the server has a firewall protecting it, but ftp is allowed to pass through. Other ideas? Server options that I might have turned off or coldfusion admin options I need to turn on? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319686 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4