Uploading an image via HTTP POST request

I have found several threads on this topic, but haven't been able to find where I'm going wrong in my code.

I'm trying to implement posting images to a website using this method, in post #11: http://www.iphonedevsdk.com/forum/iphone-sdk-development/3074-posting-file-web-site.html . I have little to no experience with PHP, and am thinking that my error is probably on that side of things. I've tried using the Obj-C code as posted (changing the URL and filename as necessary), or commenting out the lines as mentioned in post #16, with no success.

I have the following file in my root directory for PHP scripts, saved as upload.php:

...with no success upon sending POST requests with my app. I have tried commenting out lines in the app as suggested by post #16, and the response that gets logged to the console is either blank, or an error message that seems to mean that the file couldn't be copied from the temporary directory to /myappname/uploads (I'm away from my Mac at the moment and don't have the exact message ). Nothing gets uploaded to the server.

I am attempting to upload to a webhost for which I pay a monthly fee. I've tried changing the upload directory's file permissions to RWX (making it as open as possible).

One thing is most likely wrong in that PHP script is the upload path. You are giving an absolute path. I highly doubt that it's correct. Change 'uploaddir' to be just 'myappname/uploads/' (no leading slash).

And make sure the directories already exist. 'myappname' should be in the same directory as this php file and of course 'uploads' inside that directory.

I have both files in the base directory, and the 'myappname/uploads' directory in the base directory with them. I consistently get the 'File was not uploaded' error, so it looks like the file stream isn't making it to the temporary directory.

I'll try enabling verbose php error messages as well (when I figure out how...being a PHP noob ), but that's where I'm at for the moment.

Any suggestions on that? All I've done so far are those file size and type limitations in the script itself, and set the permissions on the upload folder as restrictive as possible while still being able to upload from the phone and view the files themselves.