Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 22 SEP 2008 04:01:16PM Bruce Cameron wrote:

I need to, transparently to the user, upload a file to a server using ftps.

I understand that FTPSEND function in OI operates in 'active' mode only, and the ftps server I am connecting to is 'passive' and I have confirmed that FTPSEND does not work to this server.

I then tried to use a command line with script called with Runwin (using ftp -a host -s:myscript) and that does not work either.

I understand that ftp,ftps and sftp operate differently and that ftps uses a second port but not sure if I need to speak with the

IT folks about the firewall or if there is someother function or method within OI I could use. (ActiveX object? Other DLL?)

Am looking for any help or ideas on how to best accomplish this with OI.

Thanks.


At 22 SEP 2008 04:43PM John Bouley wrote:

Bruce,

Try FileZilla Client and test if you can upload a file. That will tell you if it is a port problem. I recently setup a similar site using the FileZilla server software and had to specifically redirect the ports on the firewall to the server. Then when I connect from a client I had to put in the same port: 990 I think is standard for FTPS. It gets tricky with firewalls on the server side since the data is encrypted it can not dynamically open a port for transferring the data. (I had to hard code the data port).

Hope that helps,

John


At 22 SEP 2008 05:04PM Bruce Cameron wrote:

John,

I did try using FileZilla and could not upload. I can connect

and get in but any upload just times out. I tried with my firewall on and off. Something seems askew. Thanks for the response. Any more information is appreciated.

BC


At 22 SEP 2008 10:46PM dsig@sigafoos.org wrote:

What client works with the server? Filezilla works with both modes of transport


At 23 SEP 2008 07:39AM John Bouley wrote:

Most likely it is a problem with the setup on the server side. It is a typical problem where the authentication works but the data connection fails. I had to hard code the server's data port so I could put a rule in the firewall. The client authenticates on 990 then gets a command to connect on a different port for transferring data. Since it was a encrypted connection the data port is unknown to the firewall.

I had control of both the client and the server so I could see exactly where the failure lies…

HTH,

John


At 23 SEP 2008 09:58AM Dave Harmacek wrote:

Exactly. With a firewall you can't have it open a port designated by the connection, after the initial unencrypted connection.

So, in this case a client of mine first used a service, www.magicvortex.com. Then, when OI 8 offered an upload capability, we use a SSL connection. Thus, we have dropped ftp.

Dave


At 23 SEP 2008 01:24PM Bruce Cameron wrote:

Dave,

Can you expand on what you mean by "dropped the ftp".

Are you uploading to an FTP site using some other function

within OI other than FTPSEND as I am trying to do the upload

so that it is transparent to the user and have tried FTPSend

and also RUNWIN with a ftp script.

Thanks.


At 23 SEP 2008 01:42PM Dave Harmacek wrote:

Sorry Bruce,

I didn't read your original post clearly.

I'm not sending, just receiving.

"dropping the ftp" means I gave up on using ftp for file transfer (receiving).

Dave


At 23 SEP 2008 02:05PM Bruce Cameron wrote:

Thanks Dave.

I am looking at ways to do it using OLECreateInstance or some

sort of DLL. If anyone has suggestions or ideas…?!

I had it working with FTPSEND but just found out from thier Admin that they did in fact turn on the SSL the day after I tried my first test and therefore did not work.

Thier (testing) server is now set up accept ftp or ftps and I am not sure how to get ftps for use as a command line.

I will keep plugging away. Thanks for all the replies so far.


At 23 SEP 2008 03:27PM Leon Shaffer wrote:

Bruce, we use this:

scUserAgent="vb wininet" 
[/color]INTERNET_OPEN_TYPE_DIRECT=[/color]1 
[/color]INTERNET_INVALID_PORT_NUMBER=[/color]0 
[/color]INTERNET_SERVICE_FTP=[/color]1 
[/color]INTERNET_FLAG_PASSIVE=[/color]0X08000000 
[/color]FTP_TRANSFER_TYPE_ASCII=[/color]0X1 
[/color]bret=[/color]0 
[/color] 
[/color]MSG([/color]'Processing FTP Request.'[/color], [/color]'UB'[/color], IMAGE, [/color]''[/color]) 
[/color] 
hOpen=InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT, [/color]""[/color], [/color]""[/color], [/color]0[/color]) 
[/color]If [/color]hOPen [/color]Else [/color]Msg([/color]"Error opening Internet Object."[/color],[/color]'T3'[/color],[/color]''[/color],[/color]''[/color]) ;[/color]Return 
[/color]hConnection=InternetConnect(hOpen, SITE:[/color]\00\[/color], [/color]0[/color], FTPUSER:[/color]\00\[/color], PWD:[/color]\00\[/color], [/color]1[/color], INTERNET_FLAG_PASSIVE, [/color]0[/color]) 
[/color]if [/color]hConnection [/color]Else [/color]Msg([/color]"Error Opening Connection to the FTP Site."[/color],[/color]"T3"[/color],[/color]''[/color],[/color]''[/color]) ; [/color]Return 
[/color]bRet=FtpPutFile(hConnection, PATH:FILENAME:[/color]\00\[/color], FILENAME:[/color]\00\[/color], [/color]1[/color], [/color]0[/color]) 
[/color] 
[/color]If [/color]bRet=[/color]1 [/color]then 
  [/color]Msg([/color]'File sent successfully.'[/color],[/color]'A'[/color],[/color]''[/color],[/color]''[/color]) 
[/color]End Else 
  [/color]Msg([/color]'FTP Unsuccessful!'[/color],[/color]'A'[/color],[/color]''[/color],[/color]''[/color]) 
[/color]End[/color][/color][/size]         
               

Add this to your DLL_WININET file in SYSPROCS

<code>

[/color][/size]     

<code> WININET LONG STDCALL InternetOpenA(LPCHAR, LONG, LPCHAR, LPCHAR, LONG) AS INTERNETOPEN LONG STDCALL InternetConnectA(LONG, LPCHAR, INT, LPCHAR, LPCHAR, LONG, LONG, LONG) AS INTERNETCONNECT LPVOID STDCALL FtpPutFileA(LONG, LPCHAR, LPCHAR, LONG, LONG) AS FTPPUTFILE LONG STDCALL FtpOpenFileA(LONG, LPCHAR, LONG, LONG, LONG) AS FTPOPENFILE INT STDCALL InternetWriteFile(LONG, LPCHAR, LONG, LONG) LPVOID STDCALL InternetGetLastResponseInfoA(LONG, LPCHAR, LONG) AS InternetGetLastResponseInfo LONG STDCALL FtpFindFirstFileA(LONG, LPCHAR, LPVOID, LONG, LONG) AS FtpFindFirstFile[/color][/size]


At 23 SEP 2008 04:09PM Bruce Cameron wrote:

Leon,

Thank you. I prototyped it and wrote a test prog.

It connects but the FtpPutFile acts like it is timeing out

(in the same manner when I was manually connecting using ftp -a)

and no file gets uploaded.

Again, thank you though this is the direction I wanted to go.

I am on MSDN researching as much as possible.


At 23 SEP 2008 04:39PM Bruce Cameron wrote:

FYI - looks like you can't use WinINet for SSL.

I am looking into FtpWebRequest now.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/3babdee933b0279b852574cc006dfae0.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1