DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2006
    Posts
    2

    Upload Multiple Files using INET?

    Hello,

    I’m currently able to upload only one file at a time to my server using the code below but would like a way of uploading multiple files at a time. Can someone please help? Thank you!

    Function UploadFile(ByVal HostName As String, _
    ByVal UserName As String, _
    ByVal Password As String, _
    ByVal LocalFileName As String, _
    ByVal RemoteFileName As String) As Boolean


    ' Set FTP = New DAO ' Inet

    Dim ftp As Inet

    lblInfo.Caption = "Connecting and Uploading File . . .Please Wait."

    With ftp


    MsgBox "Local File: " & LocalFileName
    MsgBox "Remote File: " & RemoteFileName



    Inet1.Protocol = icFTP
    Inet1.RemoteHost = HostName
    Inet1.UserName = UserName
    Inet1.Password = Password
    Inet1.Execute Inet1.URL, "Put " + LocalFileName + " " + RemoteFileName



    Do While Inet1.StillExecuting

    DoEvents

    Loop


    UploadFile = (Inet1.ResponseCode = 0)

    End With

    Set ftp = Nothing

    LocalFileName = ""
    RemoteFileName = ""


    Inet1.Execute Inet1.URL, "CLOSE"
    Inet1.Cancel
    lblInfo.

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    I don't believe that the Internet Transfer Control will upload more than one file at a time. Probably because it doesn't support the mput command.

    I would just execute another Put statement, after the previous transfer has completed, for each file that needs to be uploaded.

    I don't know whether the WinInet API supports mput but you could check the Microsoft example:

    SAMPLE: VBFTP.EXE: Implementing FTP Using WinInet API from VB
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. Replies: 7
    Last Post: 03-17-2008, 10:18 AM
  2. Replies: 8
    Last Post: 06-01-2006, 10:07 AM
  3. Replies: 1
    Last Post: 11-11-2005, 08:39 AM
  4. Files upload applet
    By Erez Skubach in forum Java
    Replies: 1
    Last Post: 07-03-2002, 10:55 AM
  5. Replies: 1
    Last Post: 03-09-2001, 08:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links