POSTing an image to PHP file
<p>I'm trying to POST an image to a PHP file from my android app and am wondering what format (File, Fileoutputstream etc) I have to post it in for it to be recognized as a file and refer to it with $_FILE['filename'] in my php script.</p>

<p>Thanks :)</p>

<p><strong>EDIT:</strong></p>

<p>Sorry I may not have been clear, I'm not looking for the PHP script, I already have that finished accepting the $_FILE['sample'] and doing what I need with it, I'm just not sure the file TYPE that I have to post to the php file (IN JAVA) in order for php to 'see' it as $_FILE</p>

<p>FYI: I am using the loopj asynchronous http request library.</p>

<pre><code>public void add_image_android(final Bitmap image, String party_id, String guest_id) 
    { 

        String url = "http://www.mysite.com/urltopost";

            /* not sure what to set fOut to for the bitmap to be passed as file */

        RequestParams params = new RequestParams();
        params.put("file", fOut);
        params.put("guest_id", guest_id);
        params.put("party_id", party_id);
        client.post(url, params, new JsonHttpResponseHandler() 
        {
            @Override
            public void onSuccess(JSONObject response)
            {
                ((ResponseListener)_mainContext).add_image_android_response(response.toString());
                return; 
            }
            @Override
            public void onFailure(Throwable e) 
            {
                fireToast("api error:"+e);
                Log.d("api error:",e.toString());
            }
        });
    }
</code></pre>
