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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFTP action="putfile"...

Status
Not open for further replies.

cfm

Programmer
Mar 27, 2001
76
CL
Hello, I need to know how can I, using CFFTP, make "remotefilename" be the
same as "localfile" when it's uploaded...

using CFFILE, I just leave the target name empty, and it works, but using
CFFTP it doesn't work.

If I make remotefile="" it doesn't work.

This is the code:


/////////form.cfm///////////////////
<cfform action=&quot;test.cfm?requesttimeout=500&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;>

Select a File...<br>
<input type=&quot;File&quot; name=&quot;FILETEST&quot;>

</cfform>
///////end form.cfm///////////////////



///////test.cfm///////////////////////

Assume that it made the connection to the FTP server

<CFFTP action=&quot;open&quot;......connection=&quot;test&quot;.....etc.......>

<cfftp ACTION=&quot;PUTFILE&quot;
STOPONERROR=&quot;YES&quot;
CONNECTION=&quot;test&quot;
TIMEOUT= &quot;500&quot;
REMOTEFILE=&quot;&quot; ¿¿¿¿¿FILETEST DESTINE????????
LOCALFILE=&quot;# FILETEST #&quot;
TRANSFERMODE=&quot;auto&quot;
PASSIVE=&quot;NO&quot;>

///////end test.cfm////////////////////
 
I believe you'll need a <cffile> tag first to receive the file from the previous form. Just save it locally with <cffile> and then specify remote file name to be #cffile.clientFile# in your <cfftp> tag. You may then want to use <cffile> to delete the local file if you don't want it lingering around on the server.

Hope this helps,
GJ
 
sorry a example please.....
l'am novice.....
 
If you're new to CF, you'll want to read the docs on <cffile> as they have an example of how to do a file upload page. You should be able to take this and make it work on your system with little modifications. This will be the first step as you need to receive the file first and the example in the docs will show you how to do it.

Once you use the file upload to get the file on the server, you'll have a file that <cfftp> can work with. Once again, you need to read the chapter on <cfftp> as it will give you important background info you'll need. You will need to first create a connection with <cfftp> and then do the upload with <cfftp> with action set to &quot;putfile&quot;. The only difference in your case is that you'll want to specify the remote file name as #cffile.clientFile# which will be the name of the file the visitor sent via the upload form.

I'm sure you'd prefer a section of code that will work but I don't have time to write it and you'll learn better having the experts here help you with specific problems instead of providing you with a complete solution.

Let me know if you have any questions or get stuck with anything.
GJ
 
thank you very much!!!!
GUNJACK (MASTER)...JEJEJEJE
 
CFM GunJack absolutely right. Were here when you're ready.

Keep in mind that if you're trying to use CF server as the middle man, FTP is the last of 3 steps.

1) action page receives file from form parameter
2) CFFILE writes a file with the same name and content locally
3) CFFTP sends the local file elsewhere

You can't skip step 2.
 
yeah! it worked! thank you!

it's the panacea!!!
 
CFM why dont you cast a vote for GJ ? Thats how we say thanks around here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top