Can upload file..but 0 byte

I try to upload my file into server using post file and scots scrip.
The file was uploaded but 0 byte in a server.
anyone can help? thanks.

that solution does not work anymore for newer php versions, see also
let me recommend you to use a ftp extension


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

thankyou…i’ll try it.

i still get my uploaded file 0 byte

and this is my php script:

require_once (dirname(__FILE__).'/PHP_Compat-1.6.0a3/Compat/Function/file_get_contents.php');
$data = php_compat_file_get_contents('php://input');
$filename = $_GET['filename'];
if (file_put_contents($filename,$data)) {
if (filesize($filename) != 0) {
echo "File transfer completed.";
} else {
header("HTTP/1.0 400 Bad Request");
echo "File is empty.";
} else {
header("HTTP/1.0 400 Bad Request");
echo "File transfer failed.";

Encode file to string by Base 64 extension, and upload as text.

Ok…great…its works

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.