InetTransferLib for transfer mulitple files

F

Frank belgium

Hi,
I'm using the InetTransferLib module from Dev Ashish
(thanks Dev) but I need to Upload several files and should
loop through each file to transfer. Did anyone try this
before, and how did you make this work?
For the moment when uploading FTP file receiving 'access
denied' error, (downloading FTP no problem!) user having
full permission on folders/files!
thanks for yr help
Frank,
Belgium
 
D

Dev Ashish

Did anyone try this
before, and how did you make this work?
For the moment when uploading FTP file receiving 'access
denied' error, (downloading FTP no problem!) user having
full permission on folders/files!

Here's an updated version of the component which might make it easier
(along with a sample proc).

[ http://www.mvps.org/access/downloads/InternetTransferLib.zip ]

' *** Code Start ***
Sub UploadMultiple()
Dim cftp As FTP
Dim strLocalFile As String
Dim strTmp As String
On Error GoTo ErrHandler

Set cftp = New FTP
With cftp
' Establish a connection
.RaiseInternetAPIErrors = True
.Connect Url:="ftp://localhost", _
UsePassiveMode:=True, _
username:="ftpuser", _
password:="foobar"
'.EnumerateFolder "/"
.ChangeDirectory "/temp"
strLocalFile = Dir$("C:\temp\VBE\*.*")

Do While (Len(strLocalFile) > 0)
Call .Upload( _
TransferType:=ITL_INTERNET_FLAG_TRANSFER_BINARY,
_
LocalFileName:=strLocalFile, _
UploadURL:=.CurrentDirectory & "/" &
strLocalFile, _
OverwriteIfPresentOnServer:=True)
strLocalFile = Dir
Loop
End With

Call cftp.Disconnect
Set cftp = Nothing
Exit Sub

ErrHandler:
With Err
MsgBox "Error: " & .Number & vbCrLf & .Description, _
vbOKOnly Or vbCritical, .Source
End With
On Error Resume Next
Call cftp.Disconnect
Set cftp = Nothing
End Sub
'*** Code End ***

-- Dev
 
F

frank Belgium

I thought I posted the message to an Access (vba) group
Dev. The code in the zip file is a pure Vis.Basic project,
not really my thing... or can someone tell me if/how I can
integrate it in Access? thank you all...

frank
Belgium


-----Original Message-----
Did anyone try this
before, and how did you make this work?
For the moment when uploading FTP file receiving 'access
denied' error, (downloading FTP no problem!) user having
full permission on folders/files!

Here's an updated version of the component which might make it easier
(along with a sample proc).

[
http://www.mvps.org/access/downloads/InternetTransferLib.zi
p ]
 
D

Dev Ashish

I thought I posted the message to an Access (vba) group
Dev. The code in the zip file is a pure Vis.Basic project,
not really my thing... or can someone tell me if/how I can
integrate it in Access? thank you all...

Copy Build\InternetTransferLib.dll to an appropriate location, register it
with RegSvr32, set a reference to it from your db and you should be able to
use the code.

-- Dev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top