Sign in to follow this  
Followers 0
furso

how do i upload files via ftp

12 posts in this topic

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 ;)

Share this post


Link to post
Share on other sites



Hi,

What error are you getting?

VW

Share this post


Link to post
Share on other sites

Hi,

What error are you getting?

VW

im not getting any errors, or if i am i dont no about it. its just not copying the file

Share this post


Link to post
Share on other sites

Are you able to FTP to the XBox using DOS FTP or some other FTP client?

Share this post


Link to post
Share on other sites

i can connect via explorer without a problem, if thats what you mean. (btw thanx 4 helping)

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

i tried disabling the firewall but no luck, and i used an ftp client called flashfxp to connect successfully and transfer a file, so it must be the script.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

thanx for that script, the last error from kernal32.dll was 12003, and the _putfile error was -1. the program did however connect to the xbox without error

Share this post


Link to post
Share on other sites

w8 a mini, I JUST WORKED IT OUT, WOHO :lmao::evil: , it was all in the back slashes, turnes out the xbox directory uses forward slashes, its always sumthing simple that takes ages to track down, thanx VeeDub i owe ya one ;)

Share this post


Link to post
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
Sign in to follow this  
Followers 0