Im just trying to send a png file to a server with php
php code
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>
using this AppGameKit code Tier 1 with v1076 with matching player
g_Net_Connection = CreateHTTPConnection ( )
g_Net_Connected = SetHTTPHost ( g_Net_Connection, "192.168.137.213", 0 )//Local IP
SendHTTPFile( g_Net_Connection, "index2.php", "", "code.png" )
//SetDisplayAspect( 0.666 )
AddVirtualButton ( 1, 90, 93, 20 )
SetVirtualButtonColor( 1, 0, 255, 255 )
do
if GetHTTPResponseReady( g_Net_Connection ) = 1
print (GetHTTPResponse( g_Net_Connection ))
else
print ( GetHTTPFileProgress( g_Net_Connection ))
endif
if GetVirtualButtonState ( 1 ) = 1
//TakePicture()
endif
Sync()
loop
and I get this http://i.imgur.com/P7aadu1.png
but if I use a html form like this
<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="index2.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="3000000000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
I get this result
http://i.imgur.com/di28f1fh.png
Anyone have any ideas on 1 why AppGameKit file upload is showing as a compressed file and 2 why it is failing all together?