Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFHTTP Put Method 1

Status
Not open for further replies.

loydwilson

IS-IT--Management
Mar 30, 2001
8
0
0
Scenario is one in which I am moving image files from a local laptop running CF Developer Server to a centralized CF Enterprise server. Have been utilizing FTP to move these files with no problem but recently Fortune 500 client decided too much security risk and wants to close FTP port. Appears that CFHTTP is appropriate replacement as files are not submitted through a form in which case CFFILE would be the appropriate tag but are identified by looping through and implementation of CFDirectory tag.

Has anyone been able to utilize CFHTTP to put files onto remote server? Below is sample of existing code that runs with no error but does not move the file:

<cfhttp method="put" url="path="c:\cfusionmx\ multipart="Yes">
<cfhttpparam type="file" name="712_4412359_1.jpg" file="c:\cfusionmx\</cfhttp>


Any help provided would be greatly appreciated as I would prefer to stay in pure CF versus utilizing addl Java or ASP.

Thanks in advance.

Randy
 
lucky for you, asp can't do it... I'd like to know why they think ftp is not secure. that's what passwords are for. its no less secure than running sql server 2k.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
You can't use CFHHTP to transfer files, that is what CFFTP is for. You use CFHTTP to submit values via a URL as a post or get method.

I think CFFTTP is the only way.

[sub]
____________________________________
Just Imagine.
[sub]
 
MM says that you can use CFHTTP to transfer file. Following link outlines put method and specifically states that CFHTTP should be used as replacement for CFFTP if FTP traffic is not allowed. The link follows:


I just can't seem to get example to work.
 
You can't use CFHHTP to transfer files, that is what CFFTP is for. You use CFHTTP to submit values via a URL as a post or get method.

Guju, cfhttp is here to simulate a form submission which includes form fields such as a file type "<input type = "file">" It's also used to change page header information, include cookies and a veriety of other tasks. you should really research, or be a whole lot more familure with CF before you spout off about what CF can and can't do. you do it a lot.

loyd,
couple problems with your cfhttp code. you want to use method = "post" not "put". you don't want a file attribute in the cfhttp tag. it does something different than you expect. the only thing cfhttp and cfhttpparam does is include the file in the header, you still need to use <cffile action = "upload" ...> to save the file just like you would from a manual form submission. (henc your missunderstanding of file = "..." in your cfhttp tag)

here is a better example.


We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Thanks for no help. FYI - I just completed a $2M CF project for two Fortune 500 clients which I would guess is more than you have done in the past 6 months. But thanks for your input anyway. What a waste of time.
 
that was no help huh? someone with a bigger ego than me... hats off to you, friend. Just because you're contracting for F500 doesn't mean you know everything. I guess that's why you're posting. If you'd care to read what MM has to say on the issue ignore the link i posted. I'm sure if you follow the example you'll do just fine. turd.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
oh and fyi... i work for F500 too. you're not king of the CF hill believe it or not. none of us on this forum are. If you care to write ben forta an email he'll get back to you in about 4 months.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
all competativeness aside,
you can think this is helpful or not, what you're missing here is, when using cfhttp you need a handler of some kind. ftp has its own which is why cfftp is so nice. using cfhttp means you have to have an http server of some kind to handle the incoming file. if the recieving server is a file server only with no http listener, you can't use <cfhttp method = "put/post">. if that were possible we could put files anywere, on any server, if you knew the path. sounds less secure than ftp to me...

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top