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

Another FTP question

Status
Not open for further replies.

naguaramipana001

Technical User
Jul 20, 2008
12
US
Hi gurus.

I just need the easy and simple way to upload a file to a FTP server on another network The file might be as big as 20mb no more than that.

The last I tryed was Strom** shell solution but I get an error. can some one help on this.

Thanks a bunch
 
S.

Is not really an error is just that hangs and I cant do anything but kill the process to use computer again. will the code runs the machine hangs

Thanks
 
I use my FTP code with files much larger than 20Mb. Perhaps you could us show your version of my code in case we can see what is causing the problem for you
 
S.

Here is the code I have:

Code:
Dim ftpfolder as folder
Dim ftpshell as shell

set ftpshell =new shell

set ftpfolder=ftpshell.namespace("ftp://myusername:mypasswrod@ftp.theirdomain.com")

ftpfolder.copy "c:\myfilelocation"

There is no copyhere method on ftpfolder but copy


Now I get an Type mismatch error on "Set ftpfolder= ftpshel.namespace"

 
1) Requires reference to Microsoft Shell Controls and Automation

2) Be explicit with the declarations (I was lazy in my original examples for this):

Dim ftpfolder as Shell32.Folder
Dim ftpshell as Shell32.Shell

And then you should find that

a) Type mismatch disappears
b) CopyHere method reappears...


 
S.

Thanks a bunch for your help on this and for battling all along, thanks again. I made the changes to the code as per your request and you were right error is gone but the file that I want to upload the the outside FTP site gets saved on the folder in which the project is located.

what am I doing wrong here

Thanks again for battling

 
Code:
Dim ftpfolder As Shell32.Folder
Dim ftpshell As Shell32.Shell

Set ftpshell = New Shell32.Shell

Set ftpfolder = ftpshell.NameSpace("ftp://myusername:mypassword@ftp.theirdomain.com/myfolderwithintheirftp")

' This is the file I am trying to upload unto their FTP site

ftpfolder.CopyHere "C:\testfile.txt"

Thanks again
 
Actually, I'm stumped - that should definitely be uploading c:\testfile.txt to the myfolderwithintheirftp location
 
S.

Thanks anyways for battling with me here,I just want to make sure that you know that I am trying to get this file outside my network into another FTP server on another network?

Can I put like a time counter to wait while the ftp connection goes live?

do you think that might be the problem?

But S. thanks a bunch for all your help
 
One more quick question. If you enter ftp://myusername:mypassword@ftp.theirdomain.com/myfolderwithintheirftp as the URL in IE or in WIndows Explorer what happens?
 
S.
I dont understand, where and how should I type the url, It seems like there are two of them

the first one that is missing the myusername
mypassword@ftp.theirdomain.com/myfolderwithintheirftp"

and the second one that is more like the one on my code

target="_blank">ftp://myusername:mypassword@ftp.theirdomain.com/myfolderwithintheirftp

Excuse my ignorance

Thanks a bunch
 
sorry - TGML has mangled what I posted; I meant:

[ignore]ftp://myusername:mypassword@ftp.theirdomain.com/myfolderwithintheirftp[/ignore]


 
S.

When I go and do the following

1) put the whole address with the internal folder I get the "can get connected to the folder error"

2) put the address without the internal folder, it seems like is connected " No error "

3) it seems like when I log in the ftp directs me to the folder so I think I dont need that

4) It takes a pretty good 10-20 second for the ftp site to come in.- do you this might be the problem


Thanks a bunch S
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top