0

I am writing a script that will send all the files listed in a specific directory and post them. So far I have this

    $http = new HTTPConnection(array(array("SERVER"=>"server details", "SECURE"=>false, "METHOD"=>"POST", "URI"=>"/sender.php")));
$http->set_var("name","./test");
$http->set_var("file", base64_encode(file_get_contents('./test/csv.php', true)));
$http->exchange();

Now I want to be able to decode the file(s) but the documentation for base64_decode is a bit vague.

So far I have

$info = $_POST['file'];
echo base64_decode($info);

The error I'm getting is Undefined index: file and I am not sure how to proceed from here.

Any help is greatly appreciated!

Thanks

4

0 回答 0