CFFTP
I'm trying to connect to an ftp server with this tag and I
can't get it to work. It's frustrating because I can connect
through standard ftp or even in the browser. Even anon ftp sites
wont work.
I'm sure my proxy is the issue. I'm behind a proxy with a
password. I have read it is possible but pass a proxy password
through the cfftp tag but haven't seen it done anywhere.
Can anyone tell me how to do this?
Currently I'm using:
quote:
<cfftp
connection="Test"
action="open"
server="ftp.site.com"
username="anonymous"
password="ftp_pass"
proxyserver="proxyserverIPhere"
passive="yes"
stoponerror="no"
transfermode="binary"
/>
I can see I can pass in a proxy server ip by the proxyserver
attribute but how do I pass in my password?
Through standard ftp I would do the following:
quote:
> open ip
> username: [email protected] proxyuser
> password: ftppassword
> proxypassword: proxy password
I can't see any way to replicate that kind of behaviour using
cfftp. Any ideas?
After looking into this further as far as I can see
Coldfusion doesn't support this mode of authentication with the
CFFTP tag.
Anybody have any ideas, or any 3rd party code etc. which
would allow me to FTP through an authenticated proxy?
Similar Messages
-
Error 550 when using CFFTP to remove a file
I'm using cfftp to download files which I parse, then I need to delete the file from the server. (coldfusion 11 - development)
I can list, and download the files fine, but am butting my head into a problem that I can't seem to resolve.
USING THE SAME PATH AND FILE NAME that allowed me to 'get' the file - When I try to remove the file - I get this error.
Error: 550 file: No such file or directory .
(again - the path and file name I provide are identical to the path/filename -
if this is a permission problem, I can delete files thru Filezilla, using the same credentials - with no problem)
Here is the call to remove -
<cfftp action="remove"
connection="myConnection1"
passive="true"
timeout="360"
remotefile="#myPath##fileName#"
item="file" >I'm not sure where you got the "This is not what the docs say" part. Looking down the list of CFFTP attributes in the CF11 docs that apply to a "remove" operation, those were the attributes I would have expected to need. Although I agree the examples could be clearer and a specific example of removing a file would be useful.
-Carl V. -
I am trying to grab a file and move it to the coldfusion server using <CFFTP> The server in which I am trying to grab the file is a sftp server. I am running coldfusion 8. When I run my code, I dont get an error, I just get a blank white screen, yet the file has not been moved. I will post my code below, does anyone know what I am doing wrong?
<!--- Open conncetion with remote sftpserver --->
<cftry>
<cfftp action="open"
connection="ftpServer"
server="server.com"
username = "username"
password = "password"
fingerprint = "11:11:B5:F2:11:AF:C2:E2:31:11:D3:B4:11:83:11:11"
timeout="20"
port="22"
secure = "yes" />
<cfcatch>
<cfset throwFileTransferFailed("Could not open connection. Message: " & cfcatch.Message & ". Detail: " & cfcatch.Detail)>
</cfcatch>
</cftry>
<!--- get the file --->
<cftry>
<cfftp
action="getFile"
connection="ftpServer"
server="server.com"
username="username"
password="password"
remotefile="TEST_20100816.csv"
localfile="C:\WENS_DEV\pdf\"
failIfExists="no">
<cfcatch>
<cfset throwFileTransferFailed("Could not open connection. Message: " & cfcatch.Message & ". Detail: " & cfcatch.Detail)>
</cfcatch>
</cftry>how do I tellif the CF service has sufficient rights?
Now my code looks like this and I am still getting an error. I cant figure it out.
<cfftp action="open"
connection="ftpServer"
server="server.com"
username = "username"
password = "password"
fingerprint = "11:11:11:11:11:11:11:11:11"
timeout="30"
port="22"
secure = "yes" />
<cfftp
action="getFile"
connection="ftpServer"
remotefile="TEST_20100816.csv"
localfile="C:\WENS_DEV\pdf\TEST_20100816.csv"
failIfExists="no"> -
CFFTP using browse, filename is wrong
I want a user to be able to browse to a file on their local machine then FTP it to a remote server.I've been using CFFTP. I can make the connection to the server just fine. I have the path correct. The problem is when selecting the file through browse, it renames it as a temp file. How can I get the filename on the local computer and the remote server the same?
Since the class is in a package named "test", the Test.class file must be in a directory named "test". And it's this package directory that must be in the classpath. In your case, you should have a directory c:\java\test which contains Test.class.
-
<!---Control the timeout--->
<cfsetting requesttimeout="600">
<cfset thisDate = now()>
<cfset today = #DateFormat(thisDate,"mm-dd-yyyy")#>
<!--- Open ftp connection --->
<cfftp connection="MyFtp"
server="#FTPserver#"
username="#username#"
password="#password#"
action="Open"
stoponerror="Yes">
<cfftp action="listdir"
stopOnError="Yes"
name="Files"
directory="/export400"
connection="MyFtp"
>Try removing the quotes from around the connection name in your CFFTP lisdir block. So change the last line to connection=MyFtp instead of connection="MyFtp".
-Carl V. -
I am trying to connect to an FTP server usinfg CFFTP. The
server requires a secure connection. Does CFFTP support secure
connections?
Thanks.No. Unfortunately.
Regards,
Chris -
CFFTP character encoding / character set
I have a strange problem with downloaded text file using
cfftp at my client site. When I test on my development site, the
downloaded text file is readable. But in the production server at
my client in austria, the downloaded text file is not readable at
all. When I open the file in notepad, it's like a binary file with
a lot of special chars.
I already set the transfermode manually to ascii but still
the same. I already look for character set option for cfftp but it
seems like it doesn't have it. Does anyone know a solution for my
problem?
Btw, my client server is a linux machine, and i think the
default language is germany.
Thanks before,
TionoI tried both binary and ASCII transfermode already but result
is the same. When my client download the file directly using FTP
client and open the file, he can read the content.
I'll mail to you the FTP login information since it's a
classified info.
Thanks and best regards,
Tiono -
I am trying to utlitize cfftp in the following scenario:
1. user logs into our website.
2. user clicks link to .cfm template which uses cfftp to
display contents of their personal directory (located on our ftp
server, which is a different physical machine.)
<cfftp connection = "#session.customerid#session"
server = "ftpserver.mydomain.com"
username = "#session.customerid#"
password = "#session.password#"
action = "LISTDIR"
stopOnError = "Yes"
name = "PDFDirectory"
directory = "/pdfdir">
3. I'd like to create an ftp link for each pdf filename which
will open the specific file from the ftp server
Steps 1 and 2 are working fine. I can log into our website
and see the list of files in the directory. Step 3 is the one that
isn't working the way I thought it would. The only way I can get it
to work is to include the username/password in the ftp link:
ftp://username
[email protected]/pdfdir/file1.pdf
For security reasons, I don't want to do that. (I've tried
both hard-coding the ftp link and I've tried using the URL Query
Column from my "listdir" query object. )
I thought that once the connection to the FTP server was
open, I wouldn't need to specify the username/password again within
that cfm page. However, it seems that each of these URL's (ftp
links) is a new connection to the FTP server.
Is there another way to do what I'm trying to do - open the
file via ftp link without having to include the username/password
within the URL?
Many thanks.The CFFTP tag has its own connection between ColdFusion and
the FTP server, one connection per set of credentials.
The FTP hyperlink is a distinct connection between the user's
browser and the FTP server, completely excluding ColdFusion server.
I don't know of a way to provide a direct link to the file as
it is located on the FTP server without providing the credentials
in the URL. However, the obvious answer is to copy the file local
to the ColdFusion server and send a redirect to the client
(cflocation) to point their browser at the local file. Then
(assuming CFMX 7) using Application.cfc's onSessionEnd event,
discard the previously copied file off the server. -
Gentlemen,
I am writing a script to connect o a remote SFTP server. The server that I am trying to login to requires a "private key" which is a file that the remote authentication process uses to log you in. In Winscp I browse to the file that is my key. That is in addition to my host server name, username and password. Using cfftp I can specify the host, the username and the password but I don't know what to do when it comes to this file which is my key: filename.ppk.
Any thoughts anybody?
And I need to pass that file so my connection gets established.
Thanks!
Ysais.Thanks Mack, Now I am trying to extablish a secure FTP connection and my code is complaining about the attribute connection. I am really troubled since I need to specify a connection name to be able to reuse my connection again. This is my code:
<cftry>
<cfftp action="open" connection="VeratadFtpConnection" fingerprint="#variables.fingerprint#" key=\\server\path\key.ppk passphrase="passphrase" secure="no" server="ftp.server.com" stoponerror="no" username="someuser">
<cfcatch type="any">
<cfoutput>
#cfcatch.Message#<br />
#cfcatch.Detail#<br />
#cfcatch.Type#<br />
</cfoutput>
</cfcatch>
</cftry> -
CFFTP putFile timeouts after upgrading from ColdFusion 8 to ColdFusion 9.01
CFFTP putFile timeouts after upgrading from ColdFusion 8 to ColdFusion 9.01
Important thing to mention is that Coldfusion 9.01 is 32bit and is installed on Windows Server 2008 which is 64 bit off course.
When I try on ColdFusion 9.01 32 bit version that is installed on xp 32 bit everithing works fine.
Any Idea how this can be fixed ?attribute passive="yes" solved this problem
-
Cfftp connection attribute issue
Hi community!
I am trying to extablish a secure FTP connection and my code is complaining about the attribute connection. I am really troubled since I need to specify a connection name to be able to reuse my connection again. This is my code:
<cftry>
<cfftp action="open" connection="VeratadFtpConnection" fingerprint="#variables.fingerprint#" key=\\server\path\key.ppk passphrase="passphrase" secure="no" server="ftp.server.com" stoponerror="no" username="someuser">
<cfcatch type="any">
<cfoutput>
#cfcatch.Message#<br />
#cfcatch.Detail#<br />
#cfcatch.Type#<br />
</cfoutput>
</cfcatch>
</cftry>
I'd appreciate any thoughts!
Thanks!Go to Multiprovider change mode.
Go to Nav. Attribs Tab - selection the desired Nav. Attribs.
Go to Identification tab - Select the desired Nav. Attribs.
Good Luck,
AT -
Can someone please help. I'm trying to do a simple list of directory and the command doesn't work.
<cfftp
action="listdir"
server="~~~~~.com"
username="~~"<br> password="~~~"
name="test"
directory="out"
>
<cfdump var="#test#"> the command works fine in CF8 and CF9. But in CF10 it returns
h1. An error occurred during the FTP listdir operation.
Error: 215 . .If you can access your ftp server via any ftp client like Filezilla then you will be able to list directories via ColdFusion as well. Share the stack trace as well.
Sample Code
<cfftp
port="21"
action = "open"
username = "username"
connection = "ftp"
password = "password"
server = "abc.xyz.com"
stopOnError = "Yes">
<!--- Confirmation of Open --->
<cfoutput> Connection Open :#cfftp.succeeded# </cfoutput>
<p>List the files in a directory:
<cfftp
action = "LISTDIR"
stopOnError = "Yes"
name = "ListFiles"
directory = "/"
connection = "ftp">
<cfdump var="#ListFiles#">
<cfftp
action="close"
connection="ftp"
stopOnError = "Yes">
<!--- Confirmation of Close --->
<cfoutput> Connection Closed :#cfftp.succeeded# </cfoutput>
HTH
Thanks
VJ -
CFFTP SFTP Connection problems - CF8
I have run into a brick wall trying to make the secure
connection.
My code is as follows
<cfftp action = "open"
username = "MyUser"
connection = "MyConnection"
password = "MyPassword"
fingerprint = "fi:ng:er:pr:in:th:er:e"
server = "IP Address"
port="22"
secure = "yes">
I have confirmed the fingerprint (technically not required)
and the port.
Using FileZilla and the same parameters, I can make the SFTP
connection with no problem.
Yet in CF8 on my CrystalTech hosted account, I can't. I am
working with their support team, but have been unsuccessful for
several days.
Has anyone actually ever done this in real life? I am falling
days behind on this project.As it turns out, the webhost serving CF8 (CrystalTech) has
blocked port 22 traffic. Port 22 is the standard port for SFTP
traffic. I am working with the support team there trying to get
them to permit traffic on this port. It doesn't look hopeful. I
have now lost a good 20+ days on this issue.
Does anyone have a workaround for using SFTP in CFFTP on a
CF8 server? Need to move a file from the CF8 server to a different
server - different location... securely. -
Hi, hope somebody can help!
I'm running an evaluation on the new Coldfusion 9 and trying to use the <CFFTP> tag to connect to a remote SFTP server. The server version is:-
SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
My Code is:-
<cfftp action = "open"
username = "myusername"
connection = "MyConnection"
password = "mypassword"
server = "myserver.com"
secure = "yes">
<p>Successful: <cfoutput>#cfftp.succeeded#</cfoutput>
<cfdump var ="#MyConnection#" label="connection">
This is what is returned:-
An error occurred while establishing an sFTP connection.
Verify your connection attributes: username, password, server, fingerprint, port, key, connection, proxyServer, and secure (as applicable). Error: Session.connect: java.io.IOException: invalid data.
The error occurred in /Applications/ColdFusion9/wwwroot/test/sftp.cfm: line 12
10 :
11 : server = "10.1.3.43"
12 : secure = "yes">
13 :
14 : <p>Successful: <cfoutput>#cfftp.succeeded#</cfoutput>
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Safari/412.0
Remote Address
0:0:0:0:0:0:0:1%0
Referrer
Date/Time
13-Oct-09 11:32 PM
Stack Trace
at cfsftp2ecfm1948882534.runPage(/Applications/ColdFusion9/wwwroot/test/sftp.cfm:12) at cfsftp2ecfm1948882534.runPage(/Applications/ColdFusion9/wwwroot/test/sftp.cfm:12)
com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: invalid data
at com.jcraft.jsch.Session.connect(Unknown Source)
at com.jcraft.jsch.Session.connect(Unknown Source)
at coldfusion.tagext.net.SftpHandler.getConnection(SftpHandler.java:265)
at coldfusion.tagext.net.SftpHandler.createConnection(SftpHandler.java:76)
at coldfusion.tagext.net.FtpTag.doStartTag(FtpTag.java:675)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
at cfsftp2ecfm1948882534.runPage(/Applications/ColdFusion9/wwwroot/test/sftp.cfm:12)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:363)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)
at coldfusion.CfmServlet.service(CfmServlet.java:200)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
I've tried running this from both a Mac and Windows platform.
Incidentally, I also took the example from the Adobe Coldfusion 9 live docs and got the same error.
If I can't get this to work then it's a show stopper for the use of CF within our environment.
Best Regards,
Carl Bourne
Message was edited by: CarlB Just tried using the above to connect to a SSH (SSH-2.0-OpenSSH_5.2) server running on MAC OSX. I got the same error.That did not fix my problem specifically, but it is related, and it gave me enough insight to find a work-around without changing jar files.
It seems that ColdFusion loads "com.rsa.jsafe.provider.JsafeJCE" as the default security provider at startup. Perhaps there is something wrong with this provider like the “BC” provider mentioned in your link. Working with that, I was able to dump my providers into an array where the first array position represents the default provider and shows JsafeJCE as the default:
<cfset providerMethods = CreateObject('java','java.security.Security')>
You can dump the providers:
<cfdump var="#providerMethods.getProviders()#">
I then made a copy of the provider like:
<cfset jSafeProvider = providerMethods.getProvider('JsafeJCE')>
I then removed it from the provider array:
<cfset providerMethods.removeProvider('JsafeJCE')>
I then made my sFTP call and this time it was successful.
<cfftp action="open"
secure="true”…
I then put the provider back into the array in position 1 – the default:
<cfset providerMethods.insertProviderAt(jSafeProvider,1)>
I can’t say I know exactly what’s wrong and I certainly don’t want to remove the JsafeJCE provider from the default position for forever. I’ll let Adobe come up with a true fix, but for now, this provides me with a work-around so I can use sFTP. I’m sure JsageJCE is used/required for some other encryption, so you’ll have to watch for other issues while it’s not part of the provider array. The quicker you can get it out/in, probably the better. My sFTP only runs a few times, so I feel OK with the possible side effects. Maybe someone can take it from here and find a better solution and not a simple work-around. -
Using CFFTP, getting Error 553
I want a user to be able to browse to a file on their local machine then FTP it to a remote server.I've been using CFFTP. I can make the connection to the server just fine. I have the path correct. I keep getting an Error 553, can't create the file. My web administrator says that he has the permissions set correctly. I don't know what else to do. I've been trying to make this work for over a month. Can someone give me a hand with this? I've tried 3 times to attach the cfm file which is 2k, but it says "content type of this attachement is not allowed." I'm pasting the code below. thanks.
<fieldset><legend>Upload a form to the server</legend>
<!--- Create HTML form to upload a file --->
<cfform action="test_cfftp.cfm" enctype="multipart/form-data"method="post">
<!--- File field for user to select or specify a filename --->
<label for="fileName"><a href="" onmouseover="Tip('Search for the file to upload. i.e. EFO00001_mm-dd-yyyy.pdf')", onmouseout="UnTip()">File to upload</a></label>
<cfinput type="file" name="fileName" ><br>
<!--- Submit button to submit the form (and upload the file) --->
<cfinput type="submit" name="upload" class="mysubmit" value="Upload the File">
</cfform></fieldset>
<!--- Get the file name of this file. --->
<cfset strFilePath = "/taxweb/pubs" />
<!--- Set up the FTP configuration. --->
<cfset objFTPProperties = {
Server = "xxxxxxxx",
Port = "xx",
Username = "xxxxxx",
Password = "xxxxxxx"
} />
<!---upload the file--->
<cfftp
action="open"
connection="objConnection"
attributeCollection="#objFTPProperties#"
/>
<cfset strFilePath = "/taxweb/pubs">
<cfoutput>at line 48 fileName = #fileName# and strFilePath = #strFilePath#</cfoutput><br />
<cfoutput>at line 49 strFilePath/fileName = #strFilePath##fileName# form.fileName = #form.fileName#</cfoutput><br />
<cfftp
action="putfile"
connection="objConnection"
localfile="#form.fileName#"
remotefile="/pubs/#fileName#"
transfermode="auto"
timeout="300"
/>
<CFDUMP VAR=#cfftp#>
<!--- Close the connection. --->
<cfftp
action="close"
connection="objConnection"
/>CFFTP is for FTPing files from the ColdFusion server to/from an FTP server. It's got nothing to do with client operations.
You need to upload the file to the CF server first (via a form and a <cffile action="uplaod">), then FTP it from the CF server to the FTP server.
Adam -
I took on a new position where I have the task of going through the previous developers code and making changes/fixes. I am currently looking over a page that is grabbing a file and putting it somewhere. My issue is, that I can't seem to figure out if the variables the previous developer has in place are being called from somewhere, or if they are just placeholders. There is reference to a function that is called "TransferFile", but as I don't have alot of experience with the CFFTP tag, I just cant tell what is going on. I have underlined the variables in question. Also I am wondering if anything special has to be done since I am putting the file through a SFTP connection. The server in which I am putting the file is a linux server. I will post the code below.
<!--- Here is the function Tag --->
<cffunction name="transferFile" access="public" returnType="void" output="true" hint="Transfers the voice file to the Asterisk server via FTP.">
<cfset var ftpServer = "">
<!--- Here is the first CFFTP tag that I am assuming is connecting to the server in which I want the file to go --->
<cfftp action="open"
connection="sftpServer"
server="#"
username = "manyoh"
password = "many"
fingerprint = "#"
timeout="60"
port="22"
secure = "yes" />
<!--- Here is the CFFTP code that is putting the file with the variables I can't make out --->
<cfftp action="putFile"
connection="ftpServer"
localFile="#this.getDefaultPath() & this.getFileName()#"
remoteFile="#this.getFileName()#" />cfdumping the this scope will show you the file names.
Maybe you are looking for
-
I have a gif file which is animated when it's sent to me from a windows user. The gif is actually 10 images and when animated, it shows a coyote walking. I can't seem to get it to animate when I send it. Ideally, I'd like to add it to my signiture. A
-
I recently built a computer, and it has a problem booting windows xp, i turn it on, it gets past all the bios and raid stuff, then it gets to where windows should boot, and just sits still. I hit the restart button and it goes through the bios/raid s
-
i want to change my password but the system is not sending me message to reset my password. pls help someone is using my password without my permission and i want to change my password.
-
Problem viewing album artwork on video ipod
My problem is that I'm unable to view album artwork on my ipod in full screen, whether it's from the itunes store or if I copy/paste an album cover pic myself. You can see the artwork fine on the left next to the song/artist/album, it's just blank wh
-
Can't install HP printer 6120 in new computer Windows 7
How do I install HP printer 6120 into new computer when I can't find a place to put adapter. Is there some kind of converter I need to purchase?