What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Help!] FTP upload

[Help!] FTP upload
Author: Message:
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
34 / Male / Flag
Joined: Apr 2006
O.P. [Help!] FTP upload
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
07-07-2006 09:23 AM
Profile E-Mail PM Web Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: [Help!] FTP upload
Take a look at this script:

Status2FTP

This post was edited on 07-07-2006 at 09:28 AM by Ezra.
[Image: 1-0.png]
             
07-07-2006 09:28 AM
Profile PM Web Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
34 / Male / Flag
Joined: Apr 2006
O.P. RE: [Help!] FTP upload
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
07-07-2006 09:30 AM
Profile E-Mail PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
38 / Male / Flag
Joined: Jul 2003
RE: [Help!] FTP upload
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);

SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
07-07-2006 09:38 AM
Profile E-Mail PM Web Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
34 / Male / Flag
Joined: Apr 2006
O.P. RE: [Help!] FTP upload
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
07-07-2006 09:42 AM
Profile E-Mail PM Web Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: [Help!] FTP upload
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);

This post was edited on 07-07-2006 at 09:47 AM by Ezra.
[Image: 1-0.png]
             
07-07-2006 09:43 AM
Profile PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [Help!] FTP upload
hey.. whats with all the posting my code 8-) :P
07-07-2006 02:36 PM
Profile PM Find Quote Report
rob_botch
Full Member
***

Avatar

Posts: 180
Reputation: 4
34 / Male / Flag
Joined: Apr 2006
O.P. RE: [Help!] FTP upload
It's because you are the only one with a script to do it!

Thanks!!
07-08-2006 08:00 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On