Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: GS_HTTP/Peacekeeper-plugin [Re: broozar] #97457
11/10/06 17:07
11/10/06 17:07
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
Code:

dll_handle = dll_open("GSHTTP.dll");
HTTP_Create(0);
HTTP_Post(0,"http://here's the URL/upload.php", poster2);
while (HTTP_IsWorking(0)) {
wait(1);
}
HTTP_Free(0);
dll_close(dll_handle);



Re: GS_HTTP/Peacekeeper-plugin [Re: Joey] #97458
11/10/06 21:21
11/10/06 21:21
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
thanks, no error messages, but still no success. i bet it has something to do with the PHP part.

Re: GS_HTTP/Peacekeeper-plugin [Re: broozar] #97459
11/11/06 17:03
11/11/06 17:03
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
it's wrong, too...

Code:

<?php
// the php library can't know that you want your file attached to 'datei',
// since it does not parse the html code from above. so we need a plain php
// script that handles upload of anonymously uploaded files.
if (count($_FILES) && $_FILES[0]['error'])
{
$filename = $_FILES[0]['name'];
if (move_uploaded_file($_FILES[0]['tmp_name'], $filename)) {
echo "SUCCESS";
} else {
echo "FAILURE";
}
} else {
echo "FAILURE";
}
?>



Re: GS_HTTP/Peacekeeper-plugin [Re: Joey] #97460
11/11/06 22:22
11/11/06 22:22
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
cool, but shouldn't it be ... && !$_FILES[0]['error'] ?

and how can i use it? just send the url to the script?

Re: GS_HTTP/Peacekeeper-plugin [Re: broozar] #97461
11/12/06 12:04
11/12/06 12:04
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
it should be, yes. just use it with the c-script code from above. well, i don't know how you want to use it, but i thought you'd like to upload a file... just use the file upload command of the plugin, and the url is this php script.

Re: GS_HTTP/Peacekeeper-plugin [Re: Joey] #97462
11/12/06 12:07
11/12/06 12:07
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
hm, the fileUpload-command is HTTP_PostFile(2), your cscript code uses HTTP_Post (posting just the file path). please help me just once more... it'd be cool if it worked after all.

Re: GS_HTTP/Peacekeeper-plugin [Re: Joey] #97463
11/12/06 20:10
11/12/06 20:10
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
php script stays the same. use this c-script snippet to upload a file... afaik the file must be in the same directory as the exe file.

Code:

dll_handle = dll_open("GSHTTP.dll");
HTTP_Create(0);
HTTP_PostFile(0, "http://here's the URL/upload.php", "myfile.foo");
while (HTTP_IsWorking(0)) {
wait(1);
}
HTTP_Free(0);
dll_close(dll_handle);



Re: GS_HTTP/Peacekeeper-plugin [Re: Joey] #97464
11/12/06 21:38
11/12/06 21:38
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
PostFile does not work ("crash in GSHTTP.dll") [as the documentation says, a 4th parameter, "var_str" is needed, but it's explained nowhere what it means and how to use it), postFile2 does not upload anything, but produces no errors. i am using exactly the code you do (except for the file names). still nothing.

Re: GS_HTTP/Peacekeeper-plugin [Re: broozar] #97465
11/14/06 18:26
11/14/06 18:26
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
well, i don't know the plugin, i'm coding blindly somehow. so if you want further help, give me the source code of the dll, or at least some kind of reference as where to look for further information. the php script does work, it's indeed the dll that has a problem.

Re: GS_HTTP/Peacekeeper-plugin [Re: Joey] #97466
11/14/06 20:49
11/14/06 20:49
Joined: Jun 2005
Posts: 4,875
broozar Offline OP
Expert
broozar  Offline OP
Expert

Joined: Jun 2005
Posts: 4,875
i just had an idea - "var_str" could be the var in the php script. which one is used for the upload? filename? _FILES?

ps: dll can be found here http://www.peacekeeper.com/3dgs/http.html (version 1.3, needs some c-script update as it's been done for a5)

Page 2 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1