Server Issue

Blitz3D Forums/Blitz3D Programming/Server Issue

amitjf(Posted 2006) [#1]
How Do I (if its possible) upload files to server with username and password?(with blitz)


jfk EO-11110(Posted 2006) [#2]
there's a HTTP POST example in the archives. You must have something like a PHP script running on the server. You would then contact the PHP page like a browser does, that allows to upload files.

So you best first make a webpage that will upload a file and some input fields, plus make the PHP script that will handle the call on the server. If this is once working, you may use Blitz to act as the browser. Hint: to explore browser request headers you may easily set up a simple http server in blitz, then let your browser access it, and make blitz simply dump the browsers request to a text file. If you read this now, you'll see the exact browser request format.

So basicly you first have to learn how to do this using a browser (see HTML and PHP Tutorials). The scond step: make Blitz replace the browser, will be relative easy.

Experiments like these are easier when you have a PHP/MySql enviroment running locally, so you don't have to use FTP Uploads for every little test but simply have to hit the reload button of your browser after saveing a php script locally. There's the free EasyPHP package that contains mysql,php, apache.

An other solution would be to use the FTP protocol. But this requires to send the ftp password from every client, so maybe that's too risky.


amitjf(Posted 2006) [#3]
could you help me with some code or links?


Regular K(Posted 2006) [#4]
www.php.net
http://blitzbasic.com/codearcs/codearcs.php?cat=4


amitjf(Posted 2006) [#5]
i liked the code here:
http://blitzbasic.com/codearcs/codearcs.php?code=248

it as usefull
thx


vivaigiochi(Posted 2010) [#6]
i have used the code mentioned by amitjf, it's good code but fails with my server connection.
Instead i will use the metod of jfk EO-11110. it is the right metod for me.