Jump to content

how do i upload files via ftp


furso
 Share

Recommended Posts

hi im a bit new 2 this so bare with me, im trying to make a program to upload files to my xbox via FTP, i have been searching these forums for a while and cant find an answer, i have included ftp.au3 into my script but still no luck, here is the code im using

$ftpip = inputbox("IP address", "please enter the IP address for the xbox in form xxx.xxx.x.xxx, to find this address (on an evo x dash) turn on your xbox, connect it via ethernet cable, or wirless, to your router, or computer and go to system managment on the xbox dash, followed by system settings then type the number, including dots, you see alongside IP")
    $username = inputbox("username", "please enter the username for the xbox, by defalt it is 'xbox' (excluding quotations).")
$pass = inputbox("password", "please enter the password for the xbox, by defalt it is 'xbox' excluding quotations. note: to cheak, got to system managment, system settings again and scroll down to FTP, then read the password alongside'password'")
$driveletter = inputbox("drive letter", "please enter the drive letter of the largest drive in your xbox do not include any following colens or slashes, simply type the letter, where all programs are stored. to find this, on the system settings scroll down to hard disk, then type the letter corosponding to the largest number, ONCE AGAIN DO NOT INCLUDE THE COLEN, AS THIS IS INLUDED AUTOMATICLY")
msgbox (0, "ready", "the xbox communicator will now test the connection")
$dllhandle = DllOpen('wininet.dll')
$Open = _FTPOpen('Xbox communicator')
$server = 'ftp://' & $ftpip
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe','/' & $driveletter & '/Example.exe')
$Ftpc = _FTPClose($Open)
Dllclose($dllhandle)

pliz help, thanx. btw there will b heaps of spelling mistakes up there ^ but ill fix um later ;)

Link to comment
Share on other sites

When you connect by Explorer you're using netbios over tcpip, which is a different method to using FTP.

Your problems with your FTP upload may have nothing to do with your script, we need to isolate the problem with FTP.

So if you can use some other FTP client to upload to your XBox, then we know that it is a problem with your script. On the other hand if another FTP client can't upload either, then the problem lies elsewhere.

So first up you need to find another FTP client, or just use the windows command-line version and perform a test FTP upload using that. Depending on the outcome we will then know whether it is a script issue or some other problem not related to your script (e.g. FTP not enabled on Xbox, or incorrect user/password for instance).

Cheers,

VW

Link to comment
Share on other sites

ok this will sound stupid but when i connect via the command line, it connects, i type in my user name, press enter, and cannot type anything when I'm asked for the password. i can only press enter and close the connection, could this be the problem?

Link to comment
Share on other sites

ok this will sound stupid but when i connect via the command line, it connects, i type in my user name, press enter, and cannot type anything when I'm asked for the password. i can only press enter and close the connection, could this be the problem?

It sounds like it might be, if you're using XP do you have the Windows firewall enabled? (or some other third party firewall like ZoneAlarm etc. I would try disabling that for the moment).

You need to be able to FTP successfully to the XBox with some other FTP program that we know works first. Then when that is working, test your script again, and then if you're having problems with the script we can troubleshoot that.

Link to comment
Share on other sites

OK well try using this script to isolate the error:

#include "FTP.au3"

    AutoItSetOption("TrayIconDebug",1)

    $server = 'your Xbox IP address'
    $username = 'your username'
    $pass = 'your password'
    
    Global $INTERNET_FLAG_PASSIVE = 0x08000000
    Global $FTP_TRANSFER_TYPE_UNKNOWN = 0x00000000
    Global $FTP_TRANSFER_TYPE_ASCII = 0x00000001
    Global $FTP_TRANSFER_TYPE_BINARY = 0x00000002


    $Open = _FTPOpen('MyFTP Control')
    If $Open = 0 Then
        MsgBox(0,"FTP_Open Error",@error)
    Else
        MsgBox(0,"FTP Open completed","OK")
    EndIf   

    $Conn = _FTPConnect($Open, $server, $username, $pass)
    If $Conn = 0 Then
        MsgBox(0,"FTP_Connect Error",@error)
    Else
        MsgBox(0,"FTP Connect completed","OK")
    EndIf   

    $Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', 'notepad.exe',$FTP_TRANSFER_TYPE_BINARY)
    $Error = @error
    $lasterror = DllCall("kernel32.dll","int","GetLastError")
    msgbox(0,"LAST ERROR",$lasterror[0])
    If $Ftpp = 0 Then
        MsgBox(0,"FTP_PutFile Error",$Error)
    Else
        MsgBox(0,"FTP Put completed","OK")
    EndIf   

    $Ftpc = _FTPClose($Open)

Note the way this script is coded at the moment it will try to put notepad.exe in the root folder of your XBox FTP directory, but for testing purposes that shouldn't be a problem.

VW

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