this is the official answer:

Quote:


Just use HTTP_PostFile2()? The forth variable in HTTP_PostFile() is for
sending name=value pairs in addition to the file.

The path of the file is:

ExtractFilePath(ParamStr(0)) + StrPas(filename^.chars)

Which means ExtractFilePath(c:\whatever\whatever\myacknex.exe) + filename.

In the case of preview or whatever in A6 the file would need to be in
the same directory as the acknex EXE which is the gstudio\bin dir. Also
if you include directory slashs in that filename you have to double them up.

So:
c:\program files\gstudio\bin\acknex.exe
c:\program files\gstudio\bin\gshttp.dll
c:\program files\gstudio\bin\images\myfile.jpg
c:\program files\gstudio\bin\myfile2.jpg
c:\program files\gstudio\myproject\whatever.wdl

HTTP_PostFile2(0,
'http://www.whatever.com/whatever.php','images\\myfile.jpg');


HTTP_PostFile2(0, 'http://www.whatever.com/whatever.php','myfile2.jpg');

Published it would be something like:
c:\program files\myproject\acknex.exe
c:\program files\myproject\gshttp.dll
c:\program files\myproject\images\myfile.jpg
c:\program files\myproject\myfile2.jpg
c:\program files\myproject\whatever.wdl


Something like that.

Also, the GS_Python plugin provides more robust HTTP stuff.

Thanks,
Cellulaer





now i do get a string back, it says "FAILURE", which is certainly fron the php script. something must be wrong there.

now, this is my code:

Code:

dll_handle = dll_open("GSHTTP.dll");
HTTP_Create(0);
HTTP_PostFile2 (0, "http://whateverurl/anonymus-upload.php", serversettings); //serversettings is a file namend "workstation1.bz3", a plain text file
while (HTTP_IsWorking(0)==1) {
wait(1);
}
HTTP_Results(0,results_str);
HTTP_Free(0);
dll_close(dll_handle);
wait(1);

////////////////////////////////////////////////this was the wdl code, now the php:

<?php
if (count($_FILES) && $_FILES['name']['error'])
{
$filename = $_FILES['name']['name'];
if (move_uploaded_file($_FILES['name']['tmp_name'], $filename)) {
echo "SUCCESS";
} else {
echo "FAILURE";
}
} else {
echo "FAILURE";
}
?>