Jump to content

Uploading Files


Zoony
 Share

Recommended Posts

Alright, I've been using AutoIt for a little while now and I've come to a situation where it'd save me a lot of time if I could upload files to say an FTP server, or if I can upload files elsewhere (or even have someone download them off me like peer-to-peer). Is it possible? I haven't found anything in the help about uploading, if there's a way please tell me.

Link to comment
Share on other sites

Thanks! That partially works. It's all fine for txt files and xml files, but when I tried uploading any images or any other type of file it would always fail. So I can only upload text files? I really need to upload different files too. What can I do?

Link to comment
Share on other sites

No it works for all files the example given uses a .exe file

$server = 'ftp.example.com'
$username = 'secretusers'
$pass = 'hiddenpass'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')
$Ftpc = _FTPClose($Open)

for the Put file its the connection, the location of the file ur going to upload , and then where you want to put the file in the ftp directory

Link to comment
Share on other sites

Yes I understood the demo (although I didn't actually run that), I set the second argument as a text file (local) and I set to where I wanted to save it and it worked. But if I try that with an image, or with any other file type (possibly even exe, I'll check now) it'll return 0.

Edit: Yep, exes don't work either. Only two file types I've gotten to work (and keep working) are XML and HTML files. I'm guessing all text files work fine, but why doesn't any other file upload? :P

Edited by Zoony
Link to comment
Share on other sites

Yep. I'm sure I let them completely upload (I check when a download is finished), and yeah my Windows system can run exes and bmps. I really don't understand why it won't work, but if I describe my situation maybe you could refer me to a script someone wrote that does what I need. Right now I have a computer sitting at my friend's house (has no monitor or anything, just a standalone computer with a keyboard) which is just saving some files for me (yeah, it's like a really terrible back-up drive). I want to be able to browse through that computer and upload any files that I want (I'm achieving this by uploading the files via FTP to a server, I'm not sure if you can do peer-to-peer). I wrote a pretty crappy AutoIt script to do it. The GUI is nasty and all but it semi-works. If there's a program like this that someone has already written then could you please link me to it? I looked up that Remote Administration program but the download links were broken. Thanks.

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