Solved

Inet Control

Posted on 1998-08-20
3
205 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
3 Comments
 
LVL 12

Expert Comment

by:mark2150
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now