Re: retrieve remote images using cfhttp?

2001-03-23 Thread coldfusion

turns out that this is how you can do it...
although i couldnt find it anywhere within 3 books or any of the online help
(v4.5).

thanks for all the help and suggestions

cfhttp method="get" url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"
path="c:\images\cars\" file="myfile.jpg"/cfhttp


- Original Message -
From: [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Thursday, March 22, 2001 1:05 PM
Subject: retrieve remote images using cfhttp?


 i have been trying for the better part of the morning to figure out where
i am going wrong with the CFHTTP tag.
 i get a list of about 200 cars two times a week and the majority have
photos (with full url to other sites) but cant seem to figure out how to get
CFHTTP to download an image off of a remote site and save it locally to my
hard drive.

 suggestions? ideas? help???!!!

 here is my non-functional code so far... the header seems to return the
right info, and the mime type is also correct, but the filecontent makes no
sense to me whatsoever and i am unsure if i am doing this right, or if it is
even possible with the CFHTTP tag, or if i should be using some other tag,
or if i should be using something from the allaire developer exchange.

 cfhttp method="GET"
url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"/cfhttp
 cfoutput
 hr
 #cfhttp.header#
 hr
 #cfhttp.filecontent#
 /cfoutput


 thanks in advance.
 peter



~~
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



RE: retrieve remote images using cfhttp?

2001-03-22 Thread Bryan Love

All CFHTTP does with an action of GET is execute the page specified in the
URL and return the contents to a variable.  You can output this content and
it will look as if you had gone to that page, but you cannot just grab files
(physically) from another machine using this method.  In order to do that
you would need cooperation from whoever you want to take files from; they
would have to make a site that you can hit that would send you files, but
that is a whole other issue entirely:)

Good luck!


Bryan Love ACP
Internet Application Developer
[EMAIL PROTECTED]



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 1:06 PM
To: CF-Talk
Subject: retrieve remote images using cfhttp?


i have been trying for the better part of the morning to figure out where i
am going wrong with the CFHTTP tag.
i get a list of about 200 cars two times a week and the majority have photos
(with full url to other sites) but cant seem to figure out how to get CFHTTP
to download an image off of a remote site and save it locally to my hard
drive.

suggestions? ideas? help???!!!

here is my non-functional code so far... the header seems to return the
right info, and the mime type is also correct, but the filecontent makes no
sense to me whatsoever and i am unsure if i am doing this right, or if it is
even possible with the CFHTTP tag, or if i should be using some other tag,
or if i should be using something from the allaire developer exchange.

cfhttp method="GET"
url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"/cfhttp
cfoutput
hr
#cfhttp.header#
hr
#cfhttp.filecontent#
/cfoutput


thanks in advance.
peter
~~
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



RE: retrieve remote images using cfhttp?

2001-03-22 Thread Mike Sullivan

have you tried 'resolveurl="true"'?  ie
cfhttp method="GET" url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"
resolveurl="true"
mike
 -Original Message-
 From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
 Sent: Thursday, March 22, 2001 1:06 PM
 To:   CF-Talk
 Subject:  retrieve remote images using cfhttp?
 
 i have been trying for the better part of the morning to figure out where
 i am going wrong with the CFHTTP tag.
 i get a list of about 200 cars two times a week and the majority have
 photos (with full url to other sites) but cant seem to figure out how to
 get CFHTTP to download an image off of a remote site and save it locally
 to my hard drive.
 
 suggestions? ideas? help???!!!
 
 here is my non-functional code so far... the header seems to return the
 right info, and the mime type is also correct, but the filecontent makes
 no sense to me whatsoever and i am unsure if i am doing this right, or if
 it is even possible with the CFHTTP tag, or if i should be using some
 other tag, or if i should be using something from the allaire developer
 exchange.
 
 cfhttp method="GET"
 url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"/cfhttp
 cfoutput
 hr
 #cfhttp.header#
 hr
 #cfhttp.filecontent#
 /cfoutput
 
 
 thanks in advance.
 peter
 
 

~~
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



Re: retrieve remote images using cfhttp?

2001-03-22 Thread Jason Lotz

You are thinking too hard.  If you want to display that image, just use a
normal image tag...

img src="http://www.lexus.com/images/home/mn_ph_sc_top.jpg" . . .

No ColdFusion required.

Jason

- Original Message -
From: "Mike Sullivan" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Thursday, March 22, 2001 2:39 PM
Subject: RE: retrieve remote images using cfhttp?


 have you tried 'resolveurl="true"'?  ie
 cfhttp method="GET"
url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"
 resolveurl="true"
 mike
  -Original Message-
  From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
  Sent: Thursday, March 22, 2001 1:06 PM
  To: CF-Talk
  Subject: retrieve remote images using cfhttp?
 
  i have been trying for the better part of the morning to figure out
where
  i am going wrong with the CFHTTP tag.
  i get a list of about 200 cars two times a week and the majority have
  photos (with full url to other sites) but cant seem to figure out how to
  get CFHTTP to download an image off of a remote site and save it locally
  to my hard drive.
 
  suggestions? ideas? help???!!!
 
  here is my non-functional code so far... the header seems to return the
  right info, and the mime type is also correct, but the filecontent makes
  no sense to me whatsoever and i am unsure if i am doing this right, or
if
  it is even possible with the CFHTTP tag, or if i should be using some
  other tag, or if i should be using something from the allaire developer
  exchange.
 
  cfhttp method="GET"
  url="http://www.lexus.com/images/home/mn_ph_sc_top.jpg"/cfhttp
  cfoutput
  hr
  #cfhttp.header#
  hr
  #cfhttp.filecontent#
  /cfoutput
 
 
  thanks in advance.
  peter
 
 
 


~~
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



RE: retrieve remote images using cfhttp?

2001-03-22 Thread lsellers

 i have been trying for the better part of the morning to figure
 out where i
 am going wrong with the CFHTTP tag.
 i get a list of about 200 cars two times a week and the majority
 have photos
 (with full url to other sites) but cant seem to figure out how to
 get CFHTTP
 to download an image off of a remote site and save it locally to my hard
 drive.

You're grabbing raw binary data here (the contents of the jpeg), not text.
Try using notepad to open an image on your local machine. You'll probably
see the same thing.

You could try saving the variable as a file to your hard drive. That might
work. Probably not though. I haven't tried that in ages but as I recall CF
had issues with the NULLs (the 0's) in such variables and wouldn't properly
address the entire contents.

That may have been fixed in cf4.5. Not sure as I generally use a COM I wrote
called TCPClient to do all my CFHTTP-like work. I specifically make the COM
so it could grab and save binary data like images. :)

--min



~~
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