在php中的Iphone web app下载附件功能

I have a iphone app which use uiwebview to include a mobile site, the mobile site is developed in PHP, some of the page is allow people to download some attachments by using header force download, since the file will be convert to some binary and finally output as a download file by made use of php header function, im wondering will it be work in iphone app uiwebview too?

This site provides a script that they say works.

Here's my code sending vcard as attachement with no message:

    //create a boundary string. It must be unique
    $random_hash = md5(date('r', time())); $alt_random_hash = md5(date('r', time()+1)); 

    //read the atachment file contents into a string, 
    //encode it with MIME base64, 
    //and split it into smaller chunks 
    $attachment = (chunk_split(base64_encode(file_get_contents($url))); 
    $filename = "Alain_Leblanc.vcf";    

    // Write the email message (which will become an attachement)
    $headers .= "
    MIME-Version: 1.0 
    From: info@AlainLeblancAssurances.ca 
    Reply-To: info@AlainLeblancAssurances.ca 
    Content-Type: text/x-vcard; charset=utf-8; name=$filename; boundary=$random_hash  
    Content-Disposition: attachment; filename=$filename 
    Content-Transfer-Encoding: base64

    --$random_hash 

    $attachment

    --$random_hash-- 
    ";

    //send the email  
    $mail_sent = @mail($_POST['userEmail'], "Fiche contacts d'Alain Leblanc", "", $headers); 
    // display email result in browser
    echo $mail_sent ? "rand: ".$random_hash ."<br/>Alt: ".$alt_random_hash."<br/>".$headers : "Mail failed";