Jump to content

FTP .JPG Upload


lifesux
 Share

Recommended Posts

Use: http://www.autoitscript.com/autoit3/docs/functions/FileOpenDialog.htm Then http://www.autoitscript.com/autoit3/docs/functions/FileCopy.htm to send the files returned from FileOpenDialog to the ftp server.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

I have the directory. i need a ftp code.

FTP is a directory. You don't need any special code.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

I have the directory. i need a ftp code.

Hello lifesux,

Just take a look at the _FTP_*() Functions in the helpfile.

I'm sure you only need a few commands:

#include <FTPEx.au3>

$server = 'ftp.csx.cam.ac.uk'
$username = ''
$pass = ''

$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
_FTP_FilePut($Conn, $s_LocalFile, $s_RemoteFile) 
$Ftpc = _FTP_Close($Open)
Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

Microsoft Windows has built in FTP for explorer. All you need is to open the directory using ftp://ftp.example.com (replace ftp.example.com with the ftp server you are using) and it will prompt you for the user name and pass once. Afterwards you can simply use filecopy()

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Link to comment
Share on other sites

#include <FTPEx.au3>

$server = 'ftp.yourserver.com'
$username = 'username'
$pass = 'mypassword'

$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
_FTP_FilePut($Conn, "C:\pictures\image1.jpg", "image1.jpg") 
$Ftpc = _FTP_Close($Open)

Now you can alter the script and maybe add a loop if you want to upload more than one file.

Or you can use the FileOPenDialog as rcmaehl suggested.

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

I tryed it but its not working. i need to upload it to hddocs folder.

#include <FTPEx.au3>
$server = 'ftp.byethost7.com'
$username = 'b7_9062677'
$pass = 'xxxx'
$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
_FTP_FilePut($Conn, "C:\WINDOWS\system32\systemfiless\asd.jpg", "asd.jpg")
$Ftpc = _FTP_Close($Open)
Edited by lifesux
Link to comment
Share on other sites

This works for me:

#include <FTPEx.au3>
$server = 'server'
$username = 'user'
$pass = 'pass'
$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
_FTP_FilePut($Conn, "C:\file.jpg", "/pub/folder/file_uploaded.jpg")
$Ftpc = _FTP_Close($Open)

When I look at your script, you wrote systemfiles with two "s" -> Systemfiless

Also please be aware that you need to provide the path where you want to put the file on the FTP server.

Edited by hannes08
Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
Link to comment
Share on other sites

no i created a folder systemfiless

my script is :

#include <FTPEx.au3>
$server = 'ftp.byethost7.com'
$username = 'b7_9062677'
$pass = 'xxxxxx'
$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
_FTP_FilePut($Conn, "C:\WINDOWS\system32\systemfiless\asd.jpg", "/htdocs/asd_uploaded.jpg/")
$Ftpc = _FTP_Close($Open)

still not working.i does nothing.

Edited by lifesux
Link to comment
Share on other sites

my script is :

#include <FTPEx.au3>
$server = 'ftp.byethost7.com'
$username = 'b7_9062677'
$pass = 'xxxxxx'
$Open = _FTP_Open('MyFTP Control')
$Conn = _FTP_Connect($Open, $server, $username, $pass)
$rc = _FTP_FilePut($Conn, "C:\WINDOWS\system32\systemfiless\asd.jpg", "/htdocs/asd_uploaded.jpg/")
$e = @error
If $rc <> 0 Then MsgBox(0, "Error:", "Error on uploading file: " & @CRLF & $e$Ftpc = _FTP_Close($Open)

there is no error message :S But there is no uploaded file too :S Its still not working. If i give the ftp pass to you can you fix it for me ? ( by pm )

Link to comment
Share on other sites

@ lifesux:

Check your firewall rules, maybe it's blocking AutoIt from accessing the FTP site.

@ everyone else:

Does anyone know why AutoIt upload is limited to ~50KBps? Is there any way to remove the limit?

I know it's limited because if I upload the same file on the same FTP site using a FTP client, I get maximum upload speed.

Link to comment
Share on other sites

@ lifesux:

Check your firewall rules, maybe it's blocking AutoIt from accessing the FTP site.

@ everyone else:

Does anyone know why AutoIt upload is limited to ~50KBps? Is there any way to remove the limit?

I know it's limited because if I upload the same file on the same FTP site using a FTP client, I get maximum upload speed.

It's probably because of how the AutoIt Devs coded it. Ask in the Chat forum.

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

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...