Hmmm... can I upload via FTP with nothing but PB?

Just starting out? Need help? Post your questions and find answers here.
deadmoap
User
User
Posts: 79
Joined: Sun Feb 22, 2004 11:45 pm
Location: Riverdale, Utah
Contact:

Hmmm... can I upload via FTP with nothing but PB?

Post by deadmoap »

I really need to be able to upload via FTP... but I don't know how to do it in C++ and I don't know any DLLs either.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

Hi,

if you are using Windows, you could use the WinApi-FTP-Functions. There are several examples here in the forum and on http://www.purearea.net, like the following one :

Code: Select all

; www.purearea.net (Sourcecode collection by cnesm)
; Author:
; Date: 22. November 2003

#INTERNET_SERVICE_FTP=1
#INTERNET_OPEN_TYPE_DIRECT=1
#FTP_PORT=21
#FTP_TRANSFER_ASCII=1
#FTP_TRANSFER_BINARY=2
Proxy.s=""
ProxyBypass.s=""
ServerName.s="namedesftpservers"
UserName.s="testuser"
Password.s="testepass"
localfile.s="iptext.txt"
remotefile.s="iptext.txt"

hInternet=InternetOpen_("FTP",#INTERNET_OPEN_TYPE_DIRECT,Proxy,ProxyBypass,0)
If hInternet
  hConnect=InternetConnect_(hInternet,ServerName,#FTP_PORT,UserName,Password,#INTERNET_SERVICE_FTP,0,0)
  If hConnect
    If FtpPutFile_(hConnect,localfile,remotefile,#FTP_TRANSFER_ASCII,0)
      MessageRequester("","File has been sent",0)
    Else
      MessageRequester("Error", "Failure while sending file...",0)
    EndIf
  Else
    MessageRequester("Error", "Couldn't get a connection to the server!",0)
  EndIf
  InternetCloseHandle_(hInternet)
Else
  MessageRequester("Error", "Internet isn't reachable.",0)
EndIf
regards,
benny!
-
pe0ple ar3 str4nge!!!
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

You should be able to make ftp upload with nothing but pb. Try to telnet an ftp server, understand the commands and then study the network functions in PB.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

@deadmop:

If you do not know what thefool means ... try this as a start :
(1) open a dos-box / console-window
(2) type "telnet ftp.yourserver.com 21"
(3) after you are connected type "USER youraccount"+RETURN
(4) then type "PASS yourpassword"+RETURN
(5) type "HELP" for available commands
regards,
benny!
-
pe0ple ar3 str4nge!!!
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Read all the ftp commands, and then learn using TCP commands at PB, is hell easy. I even made an ftp client on Blitz3D using a few TCP commands.
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
Johan_Haegg
User
User
Posts: 60
Joined: Wed Apr 30, 2003 2:25 pm
Location: Västerås
Contact:

Post by Johan_Haegg »

User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

deadmoap,

Consider using REBOL. The core is free.

http://www.rebol.com/docs/core23/rebolcore-13.html
Post Reply