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

starting an FTP session?

Status
Not open for further replies.

arlequin

Programmer
Sep 21, 1999
232
UY
Hi, people!!<br><br>I wanna PUT a file into a Linux server thru a DLL...<br><br>What's the better object that VB gimme to perform this operation successfully?<br><br>I tried with Inet1 but it could not login into the FTP server... and I give it the same IP, user name and password that I use with the command line <p>Arlequin<br><a href=mailto:arlequin@montevideo.com.uy>arlequin@montevideo.com.uy</a><br><a href= </a><br>
 
should work ok Arlequin - could you post the code? <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Oh yeah....<br>of course<br><br><br><br>Private Sub Command1_Click()<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.URL = &quot;<A HREF="ftp://206.253.222.80&quot" TARGET="_new">ftp://206.253.222.80&quot</A>;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.UserName = &quot;myuser&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.Password = &quot;mypassword&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.Execute &quot;CD /etc/mail&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.Execute &quot;PUT C:\zsubir\equipo.txt equipo.txt&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.Execute &quot;CLOSE&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;Inet1.Execute &quot;QUIT&quot;<br>End Sub<br> <p>Arlequin<br><a href=mailto:arlequin@montevideo.com.uy>arlequin@montevideo.com.uy</a><br><a href= </a><br>
 
from the VB6 help<br><br>' Setting this URL will return only the file directory:<br>Inet1.URL = &quot;<A HREF=" TARGET="_new"> However, this URL will return the text of the file:<br>Inet1.URL = &quot;<A HREF=" TARGET="_new"> <br><br>have you tried it like that? setting the whole URL (inc file) I mean <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
no...<br><br><br>the problem is that I want to upload a file <p>Arlequin<br><a href=mailto:arlequin@montevideo.com.uy>arlequin@montevideo.com.uy</a><br><a href= </a><br>
 
Doh! Sorry.<br><br>Try it all in one go:<br><FONT FACE=monospace><b><br>Private Sub Command1_Click()<br><br><br>' Tek-Tips adds a semicolon at the end of the next line - delete it in your code<br>&nbsp;&nbsp;&nbsp;Inet1.URL = &quot;<A HREF="ftp://206.253.222.80&quot" TARGET="_new">ftp://206.253.222.80&quot</A>;<br>&nbsp;&nbsp;&nbsp;Inet1.Execute txtURL.Text,&nbsp;&nbsp;&quot;SEND C:\SourceDir\Sent.txt TargetDir/Sent.txt&quot;<br><br>End Sub<br></font></b><br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Here's what I'm using with few problems.<br>I access an FTP server thru a proxy server.<br>txtHST, txtUID and txtPID are text boxes.<br>txtHOST contains internet name strings without the&nbsp;&nbsp;&quot;f t p : / /&quot;<br><br><FONT FACE=monospace><br>&nbsp;&nbsp;&nbsp;&nbsp;With Inet1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.RequestTimeout = 60<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.RemoteHost = txtHST<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.UserName = txtUID<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Password = txtPWD<br>&nbsp;&nbsp;&nbsp;End With<br>...<br>&nbsp;&nbsp;Inet1.Execute <u><b>,</b></u>&quot;GET hostfile asname&quot;&nbsp;&nbsp;&nbsp;<br>...<br>&nbsp;&nbsp;Inet1.Execute <u><b>,</b></u>&quot;CLOSE&quot;<br></font><br><br>Notes: <br>Those commas are needed!<br>Designtime -- set protocol to icFTP and make sure proxy settings are usable.<br>I'm using gets, but you should be able to do sends or puts without trouble.<br><br>I think setting the URL as you do&nbsp;&nbsp;actually handles both setting the protocol and remotehost so it looks like all you need is the commas.<br>&nbsp; <p>Wil Mead<br><a href=mailto:wmead@optonline.net>wmead@optonline.net</a><br><a href= > </a><br>
 
between the get command and the close comand VB shows me an error:<br><br>ERROR 35764<br>Still Executing Last Request<br><br><br> <p>Arlequin<br><a href=mailto:arlequin@montevideo.com.uy>arlequin@montevideo.com.uy</a><br><a href= </a><br>
 
I have used the INet Control, but it was only sucessful when I tested for status/completion between EACH step (basically a loop waiting until the &quot;stillexecuting&quot; was false.<br><br>This (generally) will get past the 37654 error.<br><br>
 
My soultions usually encapsulate the FTP command and include the wait for completion processing.&nbsp;&nbsp;Sorry, that habit caused me to forget it was necessary.&nbsp;&nbsp;<br><br> <p>Wil Mead<br><a href=mailto:wmead@optonline.net>wmead@optonline.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top