Jump to content

Recommended Posts

Posted

hi mate  , where is a mistake  ? i try to upload  by ftp a screenshot  , but not work return 0 my fileput why  ???

#include <ScreenCapture.au3>
#include <FTPEx.au3>
; path save pics
$sGNameFile="istodaily"&@YEAR&@MON&@MDAY&".gif"
$sGPathSavePics=@MyDocumentsDir & "\istodaily\"&$sGNameFile
; ftp param
$sServer="ftp.byethost7.com"
$sUsername="b7_29380528"
$sPass="kronos123"

_SaveScreen()


Func _SaveScreen()
; Capture full screen
$hBmp = _ScreenCapture_Capture("")
; Save bitmap to file
 _ScreenCapture_SaveImage($sGPathSavePics, $hBmp)
 sleep(1000)
_UploadInFtp()
EndFunc


func _UploadInFtp()
$hOpen = _FTP_Open('MyFTP Control')
$hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
If @error Then
    MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR=' & @error)
Else
$hPutFile = _FTP_FilePut ( $hOpen, $sGPathSavePics , "/htdocs/"&$sGNameFile)
consolewrite ($sGPathSavePics)
MsgBox(0,"", "Open: " & $hOpen & @CRLF & "Connect: " & $hConn & @CRLF & "PutFile: " & $hPutFile)
EndIf
_FTP_Close($hConn)
_FTP_Close($hOpen)
 
EndFunc

 

Posted

i modify the ftp in this mode

 

func _UploadInFtp()
$hOpen = _FTP_Open('MyFTP Control')
$hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
_FTP_MSG()
If @error Then
    MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR=' & @error)
Else
_FTP_DirSetCurrent (  $hConn, '/htdocs/' )
_FTP_MSG()
$hPutFile = _FTP_FilePut ( $hConn, $sGPathSavePics ,  $sGNameFile,  $INTERNET_FLAG_TRANSFER_ASCII   )
_FTP_MSG()
;consolewrite ("/htdocs/"&$sGNameFile)
MsgBox(0,"", "Open: " & $hOpen & @CRLF & "Connect: " & $hConn & @CRLF & "PutFile: " & $hPutFile)
EndIf
_FTP_Close($hConn)
_FTP_Close($hOpen)
;_TelegramBot()
EndFunc

Func _FTP_MSG()
    _FTP_GetLastResponseInfo($iError,$sMessage)
    ConsoleWrite('$iError = ' & $iError & @CRLF & '$sMessage = ' & $sMessage & @CRLF)
EndFunc

return this in console

$iError = 0
$sMessage = 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 365 of 6900 allowed.
220-Local time is now 04:21. Server port: 21.
220-This is a private system - No anonymous login
220 You will be disconnected after 60 seconds of inactivity.
331 User b7_29380528 OK. Password required
230-Your bandwidth usage is restricted
230 OK. Current restricted directory is /

$iError = 0
$sMessage = 250 OK. Current directory is /htdocs

$iError = 0
$sMessage = 200 TYPE is now ASCII
500 I won't open a connection to 100.112.219.218 (only to 146.241.224.52)
500 Unknown command

by file zilla i can open and browse  but  i dont know  why respond me

500 I won't open a connection to 100.112.219.218 (only to 146.241.224.52)
500 Unknown command

o_O

  • Developers
Posted (edited)

The @Extended error returned is 12018 for _FTP_FilePut() and I get a Certificate error when connecting  with FileZilla.
Not sure how this needs to be solved.

The message was about it hostname not being the correct one in the certificate.

You do realize the posted Userid & Password can now be used be everyone that seen it?!   ;) 

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted
6 minutes ago, Jos said:

You do realize the posted Userid & Password can now be used be everyone that seen it?!   ;) 

yes  dont worry is  free hosting web  and  is clean after test i remove

Posted (edited)
On 8/10/2021 at 3:24 AM, Abladus said:

500 I won't open a connection to 100.112.219.218 (only to 146.241.224.52)

On 8/10/2021 at 3:47 AM, Abladus said:

is possible change ip address in fileput ?

This error is usually caused when a FTP client opens an ACTIVE data connection behind a firewall that isn't configured to handle ACTIVE FTP data connections.  In these cases, when the FTP server is configured for it, the FTP client should use a PASSIVE (PASV) data connection to the FTP server.  I won't go into the differences between ACTIVE and PASV FTP data connections, you can look it up for yourself. 

By default, _FTP_Connnet() will open an ACTIVE data connection.  To open PASV data connections to your FTP server, just change the line below:

(I created a small test script, using a PASV connection, to verify the uploading & deleting of a small text file using the server & credentials that you provided and it was successful.)

Change

$hConn = _FTP_Connect($hOpen, "ftp.byethost7.com", "<user_id>", "<password>")

To

$hConn = _FTP_Connect($hOpen, "ftp.byethost7.com", "<user_id>", "<password>", 1)
Edited by TheXman

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
  • Recently Browsing   0 members

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