Solved

Inet Control

Posted on 1998-08-20
3
212 Views
Last Modified: 2009-12-16
I am making a app which will upload files to a server. How can i list whats in a dir on the users hardrive and whats in the servers dir? i'd like the user to be able to drag a file from his/her file list box to the servers, then click upload and it will upload. How?
0
Comment
Question by:jmharr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1430102
You can show off whats on the users drive with the SHOWOPEN option of the CommonDialog control or you could repeatedly use the DIR() command to populate a data structure of your own choosing.

I believe that the LS command will respond with a list of the available files on the host side of things. Again, you would capture the data and populate the matching data structure.


0
 

Author Comment

by:jmharr
ID: 1430103
i have no idea on doign any of that, and remember! i need to be able to drag it to the servers side and press upload and it will upload
0
 
LVL 14

Accepted Solution

by:
waty earned 60 total points
ID: 1430104
There is a function I use in one of my project to retreive the file on the server. You have to add the drag and drop parts.
See your other question for more code

Sub FTPWaitForResponse()
   ' *** After executing an FTP command, we have to wait for it to complete
   ' *** before we undertake any further processing.

   Do Until Not Inet.StillExecuting
       DoEvents
   Loop

End Sub

Private Sub Inet_StateChanged(ByVal State As Integer)
   ' *** State change in the connection
   
   Dim sTmp          As String
   
   Select Case State
      Case icError
         If (Inet.ResponseCode <> 0) And (Inet.ResponseCode <> 12003) Then
            Log "Connection Error : " & Inet.ResponseCode & ", Error : " & Inet.ResponseInfo, LOG_TYPE_ERROR
        End If
       
      Case icResponseCompleted ' 12
         sTmp = FTPGetText()
         
   End Select
   
End Sub

Function FTPGetText() As String
   ' *** Retrieve any text data that the remote sever has returned to us.
     
    Dim vChunk As Variant
    Dim sData  As String
    Dim bDone  As Boolean

    bDone = False
    vChunk = Inet.GetChunk(256)
    Do Until bDone
        sData = sData & vChunk
        vChunk = Inet.GetChunk(256)
        If Len(vChunk) = 0 Then
            bDone = True
        End If
    Loop
     
    FTPGetText = sData
    Debug.Print sData
     
End Function

Sub GetFileList(sDirectory As String, asFiles)

   ' This function will fill the array 'asFiles' with the directory
   ' entries that have been returned as part of the sDirectory string.
   
   Dim i          As Integer
   Dim iLastIndex As Integer
   
   iLastIndex = 0
   
   Do Until Len(sDirectory) = 0
      For i = 1 To Len(sDirectory)
         If Mid$(sDirectory, i, 1) = Chr$(13) Then
            If Len(sDirectory) <= 2 Then
               sDirectory = "" 
               Exit For
            End If
             
            ReDim Preserve asFiles(iLastIndex)
            asFiles(iLastIndex) = Left$(sDirectory, i - 1)
            iLastIndex = iLastIndex + 1
            sDirectory = Mid$(sDirectory, i + 2)
            Exit For
         
         End If
      Next
   Loop
   
End Sub
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question