0

I get an error with my code to receive data from my android app. could someone please resolve my issue with this. I have included the error that I get when I POST the data.

<?php

    $filename = "uploads/";

    $filename = $filename."data".date.".txt";

    file_put_contents($filename, $_POST) ;


?>

Error log:

[14-May-2012 09:49:32 UTC] PHP Warning: file_put_contents(uploads/datadate.txt) [function.file-put-contents]: failed to open stream: No such file or directory in /home/kiwigami/public_html/upload.php on line 27

2
  • 1
    try the full path for the file and make sure the permissions are correct. Commented May 14, 2012 at 9:54
  • what is date in this line $filename = $filename."data".date.".txt"; Commented May 14, 2012 at 9:56

1 Answer 1

2

Make sure that you have a uploads directory under /home/kiwigami/public_html/

Sign up to request clarification or add additional context in comments.

1 Comment

+1, And make sure the uploads directory is writable by the web server user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.