Shoutbox

[Help!] FTP upload - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Help!] FTP upload (/showthread.php?tid=62731)

[Help!] FTP upload by rob_botch on 07-07-2006 at 09:23 AM

I have written a script that generates an XML file. I now want to upload this file to an ftp server. How would I go about doing this?

Thank you,

Robert


RE: [Help!] FTP upload by Ezra on 07-07-2006 at 09:28 AM

Take a look at this script:

Status2FTP


RE: [Help!] FTP upload by rob_botch on 07-07-2006 at 09:30 AM

Thank you. I have looked at that script, but it is quite complicated to transfer to my script, as it is already tailored to the needs of that script. What I want to do is (I think) less complicated. I just need the code to upload a file and then close the connection.

Any help would be much appreciated,

Robert


RE: [Help!] FTP upload by Dempsey on 07-07-2006 at 09:38 AM

Something like...

quote:
Originally posted by Status2FTP

//Connect
Interop.Call('wininet', 'InternetConnectW', ConnectionHandle, ConfigArray.Server, ConfigArray.Port * 1, ConfigArray.Username, ConfigArray.Password, 1, 1, 0);

   //Set FTP Dir
Interop.Call('wininet', 'FtpSetCurrentDirectoryW', result, ConfigArray.Directory);

   //Upload File
   Interop.Call('wininet', 'FtpPutFileW', result, DetailsArray.DP, dpname, 2, 0);

    //Close FTP connection
    Interop.Call('wininet', 'InternetCloseHandle', result);


RE: [Help!] FTP upload by rob_botch on 07-07-2006 at 09:42 AM

Thnak you very much. I can work out what most of the variables refer to, but there are a few properties that I am a bit confused about:

What is ConnectionHandle (and its value?)
What does "result" refer to?
What are the properties DetailsArray.DP and dpname?


Thank you,

Robert


RE: [Help!] FTP upload by Ezra on 07-07-2006 at 09:43 AM

quote:
Originally posted by rob_botch

Thnak you very much. I can work out what most of the variables refer to, but there are a few properties that I am a bit confused about:

What is ConnectionHandle (and its value?)
What does "result" refer to?
What are the properties DetailsArray.DP and dpname?


Thank you,

Robert

The ConnectionHandle is the pointer to the Connection you started, this way you could handle more than one connection.

result is the result you get back from the api to see if everything went ok.

DetailsArray.DP is the location of the file you want to upload and dpname is the filename

BTW: Dempsey forgot the to make the connection :P
code:
ConnectionHandle = Interop.Call('wininet', 'InternetOpenW', 'Connectionname', 0, 0, 0, 1);

RE: [Help!] FTP upload by Eljay on 07-07-2006 at 02:36 PM

hey.. whats with all the posting my code 8-) :P


RE: [Help!] FTP upload by rob_botch on 07-08-2006 at 08:00 AM

It's because you are the only one with a script to do it!

Thanks!!