Hi,
sorry to wake up an old thread, but I'm trying to figure out HTTP Post with files.
I have managed to send variables to a very simple php script:
here is the php script:
<?php
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
ob_start();
print_r($_FILES);
print_r($_POST);
print_r($_REQUEST);
$string = ob_get_clean();
fwrite($fh, $string);
fclose($fh);
?>
The script prints all types of form posting methods and writes it to
file.
This worked:
====================
Server:Port192.168.1.64/android/test.phpPath:<left it blank>
Data/File:data1=item1
data2=item2
Cookies:<left blank>
Timeout:30
Content Type:application/x-www-form-urlencode
============================
However when I tried to use a file, it didnt:
but I couldn't send a file?!
=================
Server:Port
192.168.1.64/android/test.php
Path:
<left it blank>
Data/File:
* I used the magnifying glass to browse to a file and this was the resulting path :*
/mnt/sdcard/wallpaper/image.jpg
Cookies:
<left blank>
Timeout:
30
Content Type:
* it changed automatically to:*
application/octet-stream
=======================
When I ran the task and then open the testFile.txt all I see is:
array()array()array()
What am I doing wrong? or is there a bug when we try to upload a file?
Thanks,
Sinan