Search code examples
iphoneobjective-cxcodeconfiguration-files

Open a Configuration Profile through app


I have a .mobileconfig file in one URL. I am sending the Http post from xcode(When a button is clicked), the http post contains the .mobileconfig url. Can i download that file when the button is clicked ?


Solution

  • When it comes to serving up this file. It needs to be served up with a MIME Content-Type of application/x-apple-aspen-config. You may be able to do this by adding a line to your server's configuration or .htaccess file in the folder with:

    <IfModule mod_mime.c>
        AddType application/x-apple-aspen-config .mobileconfig
    </IfModule>
    

    If serving the file from within PHP, you may do something like:

    header('Content-type: application/x-apple-aspen-config; charset=utf-8');
    header('Content-Disposition: attachment; filename="company.mobileconfig"');
    echo $mobileconfig;