Jump to content

how can i use FTPMAKEDIR..


Recommended Posts

By reading the documentation

;===============================================================================
;
; Function Name:    _FTPMakeDir()
; Description:      Makes an Directory on an FTP server.
; Parameter(s):     $l_FTPSession   - The Long from _FTPConnect()
;                   $s_Remote       - The file name to be deleted.
; Requirement(s):   DllCall, wininet.dll
; Return Value(s):  On Success - 1
;                   On Failure - 0
; Author(s):        Wouter van Kesteren
;
;===============================================================================

Func _FTPMakeDir($l_FTPSession, $s_Remote)
    
    Local $ai_FTPMakeDir = DllCall('wininet.dll', 'int', 'FtpCreateDirectory', 'long', $l_FTPSession, 'str', $s_Remote)
    If @error OR $ai_FTPMakeDir[0] = 0 Then
        SetError(-1)
        Return 0
    EndIf
    
    Return $ai_FTPMakeDir[0]
    
EndFunc ;==> _FTPMakeDir()
Link to comment
Share on other sites

;===============================================================================

;

; Function Name: _FTPMakeDir()

; Description: Makes an Directory on an FTP server.

; Parameter(s): $l_FTPSession - The Long from _FTPConnect()

; $s_Remote - The file name to be deleted.

; Requirement(s): DllCall, wininet.dll

; Return Value(s): On Success - 1

; On Failure - 0

; Author(s): Wouter van Kesteren

;

;===============================================================================

Func _FTPMakeDir($l_FTPSession, $s_Remote)

Local $ai_FTPMakeDir = DllCall('wininet.dll', 'int', 'FtpCreateDirectory', 'long', $l_FTPSession, 'str', $s_Remote)

If @error OR $ai_FTPMakeDir[0] = 0 Then

SetError(-1)

Return 0

EndIf

Return $ai_FTPMakeDir[0]

EndFunc ;==> _FTPMakeDir()

; $s_Remote - The file name to be deleted. ..?

i dont want to delete file.. i dont under stand it

i tryd doing somthing like this

$server = '*******'

$username = '********'

$pass = '********'

$Open = _FTPOpen('MyFTP Control')

$Conn = _FTPConnect($Open, $server, $username, $pass)

$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')

$Ftpc = _FTPClose($Open)

DllOpen ( "wininet.dll" )

$s_Remote = "WOOOOOT"

_FTPMakeDir($Conn, "New_Directory )

and it doesnt work

Link to comment
Share on other sites

well first of all "New_Directory doesnt have a closing ". second thats wrong. $s_Remote should be the file to delete. not sure why but thats how it works.

_FTPMakeDir($Conn, "test.txt")

Please use

[code]
tags to show long lines of code Edited by Mast3rpyr0
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...