PHP Remote Image Process to save image on my server using the Picup App for mobile safari
<p>I can't get the image to save in the /image_upload/uploads/ folder (then I can hopefully figure out the rest).</p>

<p>This is the code I got from <a href="http://www.parorrey.com/" rel="nofollow">parorrey.com</a></p>

<pre><code>&lt;?php
//remote image to copy
 $remoteImageURL = 'http://www.mywebsite.com/image.jpg';  //I'm not sure what URL should be here

 //local directory to store image
$dir_path = 'http://www.mywebsite.com/image_upload/uploads/'; 

if($remoteImageURL)
{ 
    require_once('class.get.image.php');

    // initialize the class
    $image = new GetImage;

    // just an image URL
    $image-&gt;source = $remoteImageURL;
    $image-&gt;save_to = $dir_path; // with trailing slash at the end

    $get = $image-&gt;download('curl'); // using cURL

    $pic = $dir_path.basename($remoteImageURL);

    //you can use the picture path e.g. Insert into DB from this variable $pic
 ?&gt;
</code></pre>

<p>This is some of the code for the PICUP application</p>

<pre><code>&lt;script&gt; 
    var currentParams = {}
    document.observe('dom:loaded', function()
    {

        $(document.body).addClassName('iphone');

        // We'll check the hash when the page loads in-case it was opened in a new page
        // due to memory constraints
        Picup.checkHash();  

        // Set some starter params  
        currentParams = {
        'callbackURL'       : 'http://mywebsite.com/upload_pic5.php',   
        'postURL'           :       'http://www.mywebsite.com/image_upload/picup_remote_image.php', 
        'referrername'      : escape('mywebsite'),
        'referrerfavicon'   : escape('http://mywebsite.com/kwboat.ico'),
        'purpose'               : escape('Select your photo for our App.'),
        'debug'         : 'false',
        'returnThumbnailDataURL': 'true',
        'thumbnailSize'         : '150'
        };

        Picup.convertFileInput($('photo'), currentParams);

    });
&lt;/script&gt;   

&lt;script type="text/javascript"&gt;
    window.name = "fileupload";
&lt;/script&gt;
</code></pre>

<p>This is my form code</p>

<pre><code>&lt;form action="save.php" method="post" id="add_boat"&gt;
&lt;div class="step_bar_info"&gt;Upload a Picture of your boat&lt;/div&gt;
&lt;div id="image_box"&gt;

&lt;div id="upload_area"&gt;
&lt;?php if (isset($image_url))
{
    echo '&lt;img src="' . $image_url .'" /&gt;';
}
else
{
    echo '&lt;img src="images/boat.png" width="150px"/&gt;';  
} ?&gt;
&lt;/div&gt;

&lt;input type="file" name="photo" id="photo"/&gt;&lt;br /&gt;
Please select your photo to upload, you will need to &lt;a   href="http://itunes.apple.com/us/app/picup/id354101378?mt=8" target="_blank"&gt;install Picup App (Free) from iTunes.&lt;/a&gt; &lt;br /&gt;&lt;br /&gt; Picup is a free iPhone app that facilitates photo uploads to our web app. Since Mobile Safari doesnt support file-upload form fields

&lt;?php $image_url=($pic); ?&gt;&lt;!--  gets from image processor though maybe should just change $pic  --&gt;    
&lt;/div&gt;&lt;!--image box--&gt;
&lt;input type="hidden" id="image_url" name="image_url" value="images/boat.png"/&gt;
&lt;div id="titlebox"&gt;Boats name&lt;br/&gt;&lt;input name="title" type="text" size="24"   maxlength="60" value="" tabindex="1"&gt;&lt;/div&gt;&lt;!--endtitlebox--&gt;
&lt;div id="info_box"&gt;Info&lt;br/&gt;&lt;textarea name="info" cols="20" maxlength="100" rows="2"    tabindex="6"&gt;&lt;/textarea&gt;&lt;/div&gt;
&lt;input id="add_boat" type="submit" name="add_boat" value="save " alt="submit" title="Save item in our secure database system " /&gt;

&lt;/form&gt;
</code></pre>
