Internet Transfer Module 
Author Message
 Internet Transfer Module

Is there any way to delete a file of the remote ftp server and / or get a
listing (LS command) using the great Dev Ashish's Internet transfer module
(or any other way).

Pre- Thank you

Jo

______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.*-*-*.com/
   With Seven Servers In California And Texas - The Worlds Uncensored News Source



Fri, 19 Sep 2003 18:43:58 GMT  
 Internet Transfer Module
Jo,

Don't know if this is what you want but its what I use!

 Dim f As FileSystemObject

Set f = New FileSystemObject
    f.CopyFile "\\192.168.1.31\file\data, "\\192.168.1.31\file\data.backup,
True
    Set f = Nothing

This only copies it but you can also use f.DeleteFile

Graeme

PS. Where is the great Dev Ashish's Internet transfer module???


Quote:
> Is there any way to delete a file of the remote ftp server and / or get a
> listing (LS command) using the great Dev Ashish's Internet transfer module
> (or any other way).

> Pre- Thank you

> Jo

> ______________________________________________________________________
> Posted Via Uncensored-News.Com - Still Only $9.95 -

http://www.uncensored-news.com
Quote:
>    With Seven Servers In California And Texas - The Worlds Uncensored News
Source



Fri, 19 Sep 2003 22:56:55 GMT  
 Internet Transfer Module
Jo,

Don't know if this is what you want but its what I use!

 Dim f As FileSystemObject

Set f = New FileSystemObject
    f.CopyFile "\\192.168.1.31\file\data, "\\192.168.1.31\file\data.backup,
True
    Set f = Nothing

This only copies it but you can also use f.DeleteFile

Graeme

PS. Where is the great Dev Ashish's Internet transfer module???


Quote:
> Is there any way to delete a file of the remote ftp server and / or get a
> listing (LS command) using the great Dev Ashish's Internet transfer module
> (or any other way).

> Pre- Thank you

> Jo

> ______________________________________________________________________
> Posted Via Uncensored-News.Com - Still Only $9.95 -

http://www.uncensored-news.com
Quote:
>    With Seven Servers In California And Texas - The Worlds Uncensored News
Source



Fri, 19 Sep 2003 22:58:10 GMT  
 Internet Transfer Module
Graeme Brouder wrote

Quote:
> Dim f As FileSystemObject

>Set f = New FileSystemObject
>    f.CopyFile "\\192.168.1.31\file\data,
>    "\\192.168.1.31\file\data.backup,
>True
>    Set f = Nothing

>This only copies it but you can also use f.DeleteFile

This assumes that the URL is located within the corporate firewall, on
the intranet, if you will.

Quote:
>PS. Where is the great Dev Ashish's Internet transfer module???

It's not great or anything, but it's available at the following link,
FWIW.

 [ http://www.mvps.org/access/modules/mdl0037.htm ]

  -- Dev



Sat, 20 Sep 2003 05:17:39 GMT  
 Internet Transfer Module
Jo wrote

Quote:
>Is there any way to delete a file of the remote ftp server and /
>or get a listing (LS command) using the great Dev Ashish's
>Internet transfer module (or any other way).

Delete a file:
  call FTPDeleteFile

Public Declare Function FtpDeleteFile _
    Lib "WinInet.dll" Alias "FtpDeleteFileA" _
    (ByVal hConnect As Long, _
    ByVal lpszFileName As String) _
    As Long

FtpDeleteFile(m_hConnect, FileName)

Get a Listing:
  The easier way would be to call FtpFindFirstFile and
InternetFindNextFile recursively. Something like

' ******* Code STart **********
Private Static Sub sEnumerateFolder(strFolderName As String, Optional
strSearchArg As String = SEARCH_ARG)
On Error GoTo ErrHandler
Dim tDirInfo As WIN32_FIND_DATA
Dim hDir As Long, lngRet As Long

    hDir = FtpFindFirstFile(m_hConnect, strSearchArg, tDirInfo,
ITL_INTERNET_FLAG_RESYNCHRONIZE, 0)
    If Not (CBool(hDir)) Then
        If (Err.LastDllError <> ITL_ERROR_NO_MORE_FILES) Then
            m_blnIsErr = fAssertInetErr(True, m_strExecContext,
RaiseInternetAPIErrors)
            If (m_blnIsErr) Then Err.Raise ERR_GENERIC
        Else
            ' no files
            Call m_Files.ClearCollection
            Call m_Folders.ClearCollection
        End If
    Else
        Set m_Folders = New Folders
        Set m_Files = New Files
        If (tDirInfo.dwFileAttributes = ITL_FILE_ATTRIBUTE_DIRECTORY)
Then
            m_Folders.Add fTrimNull(tDirInfo.cFileName)
        Else
            m_Files.Add tDirInfo
        End If

        lngRet = InternetFindNextFile(hDir, tDirInfo)
        m_blnIsErr = fAssertInetErr(lngRet = 0 And (Err.LastDllError
<> ITL_ERROR_NO_MORE_FILES), m_strExecContext, RaiseInternetAPIErrors)
        If (m_blnIsErr) Then Err.Raise ERR_GENERIC

        Do While (lngRet > 0 And Err.LastDllError <>
ITL_ERROR_NO_MORE_FILES)
            With tDirInfo
                If (.dwFileAttributes = ITL_FILE_ATTRIBUTE_DIRECTORY)
Then
                    m_Folders.Add fTrimNull(.cFileName)
                Else
                    m_Files.Add tDirInfo
                End If
            End With

            lngRet = InternetFindNextFile(hDir, tDirInfo)
            m_blnIsErr = fAssertInetErr((lngRet = 0) And
(Err.LastDllError <> ITL_ERROR_NO_MORE_FILES), _
                                        m_strExecContext,
RaiseInternetAPIErrors)
            If (m_blnIsErr) Then Err.Raise ERR_GENERIC

        Loop
    End If
    Call InternetCloseHandle(hDir)
    Exit Sub
ErrHandler:
    Call InternetCloseHandle(hDir)
    With Err
        If (.Number <> ERR_GENERIC) Then
            .Raise .Number, .source, .Description, .HelpFile,
.HelpContext
        End If
    End With
End Sub
' ******** Code End **************

  -- Dev



Sat, 20 Sep 2003 05:16:18 GMT  
 Internet Transfer Module
Thanks Dev Ashish,

And don't put your self down, it saved me a few days of code, it IS great.

Jo


Quote:
> Jo wrote

> >Is there any way to delete a file of the remote ftp server and /
> >or get a listing (LS command) using the great Dev Ashish's
> >Internet transfer module (or any other way).

> Delete a file:
>   call FTPDeleteFile

> Public Declare Function FtpDeleteFile _
>     Lib "WinInet.dll" Alias "FtpDeleteFileA" _
>     (ByVal hConnect As Long, _
>     ByVal lpszFileName As String) _
>     As Long

> FtpDeleteFile(m_hConnect, FileName)

> Get a Listing:
>   The easier way would be to call FtpFindFirstFile and
> InternetFindNextFile recursively. Something like

> ' ******* Code STart **********
> Private Static Sub sEnumerateFolder(strFolderName As String, Optional
> strSearchArg As String = SEARCH_ARG)
> On Error GoTo ErrHandler
> Dim tDirInfo As WIN32_FIND_DATA
> Dim hDir As Long, lngRet As Long

>     hDir = FtpFindFirstFile(m_hConnect, strSearchArg, tDirInfo,
> ITL_INTERNET_FLAG_RESYNCHRONIZE, 0)
>     If Not (CBool(hDir)) Then
>         If (Err.LastDllError <> ITL_ERROR_NO_MORE_FILES) Then
>             m_blnIsErr = fAssertInetErr(True, m_strExecContext,
> RaiseInternetAPIErrors)
>             If (m_blnIsErr) Then Err.Raise ERR_GENERIC
>         Else
>             ' no files
>             Call m_Files.ClearCollection
>             Call m_Folders.ClearCollection
>         End If
>     Else
>         Set m_Folders = New Folders
>         Set m_Files = New Files
>         If (tDirInfo.dwFileAttributes = ITL_FILE_ATTRIBUTE_DIRECTORY)
> Then
>             m_Folders.Add fTrimNull(tDirInfo.cFileName)
>         Else
>             m_Files.Add tDirInfo
>         End If

>         lngRet = InternetFindNextFile(hDir, tDirInfo)
>         m_blnIsErr = fAssertInetErr(lngRet = 0 And (Err.LastDllError
> <> ITL_ERROR_NO_MORE_FILES), m_strExecContext, RaiseInternetAPIErrors)
>         If (m_blnIsErr) Then Err.Raise ERR_GENERIC

>         Do While (lngRet > 0 And Err.LastDllError <>
> ITL_ERROR_NO_MORE_FILES)
>             With tDirInfo
>                 If (.dwFileAttributes = ITL_FILE_ATTRIBUTE_DIRECTORY)
> Then
>                     m_Folders.Add fTrimNull(.cFileName)
>                 Else
>                     m_Files.Add tDirInfo
>                 End If
>             End With

>             lngRet = InternetFindNextFile(hDir, tDirInfo)
>             m_blnIsErr = fAssertInetErr((lngRet = 0) And
> (Err.LastDllError <> ITL_ERROR_NO_MORE_FILES), _
>                                         m_strExecContext,
> RaiseInternetAPIErrors)
>             If (m_blnIsErr) Then Err.Raise ERR_GENERIC

>         Loop
>     End If
>     Call InternetCloseHandle(hDir)
>     Exit Sub
> ErrHandler:
>     Call InternetCloseHandle(hDir)
>     With Err
>         If (.Number <> ERR_GENERIC) Then
>             .Raise .Number, .source, .Description, .HelpFile,
> .HelpContext
>         End If
>     End With
> End Sub
> ' ******** Code End **************

>   -- Dev

______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
   With Seven Servers In California And Texas - The Worlds Uncensored News Source


Sat, 20 Sep 2003 20:36:55 GMT  
 Internet Transfer Module
Dev,

I've got brain ach again!
I'm trying to insert

Private Declare Function FtpDeleteFile _
    Lib "WinInet.dll" Alias "FtpDeleteFileA" _
    (ByVal hConnect As Long, _
    ByVal lpszFileName As String) _
    As Long
into the Inet Transfer mda and call it with somthing like

Public Property Let KillFtp(FileName As String)
    apiFtpDeleteFile hsession, FileName
End Property

I've got the property .KillFTP but I'm Sure I'm wrong with the hsession.

What information do I put into hConnect in the api above?
and am I on the right track?

Cheers

again

Jo

______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
   With Seven Servers In California And Texas - The Worlds Uncensored News Source



Sun, 21 Sep 2003 03:34:19 GMT  
 Internet Transfer Module
I believe I've replied to thispost in another thread.

 -- Dev



Mon, 22 Sep 2003 07:34:12 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Want to use Internet transfer control in Module

2. Monitoring Data Transfer of Internet Transfer Contol

3. Internet Transfer Control and ASCII transfer Help?

4. Internet Transfer Control and ASCII transfer Help?

5. Internet Transfer Control stalls transfer abruptly

6. How to transfer a file greater than 64Kb w/ internet transfer ctrl

7. Setting transfer type in Internet Transfer Control

8. Internet Transfer Control and ASCII transfer Help?

9. HOWTO: Securely transfer a file using the Internet Transfer Control

10. Internet Internet Transfer control

11. Disconnecting for Internet After Using Internet Transfer Control

 

 
Powered by phpBB® Forum Software