I have book my itinerary and the travel website delivered the ticket along with the pkpassfiles. Unfortunately neither Safari nor Chrome detects it and show the option to open in passbook application. It shows options like FileApp/CHM reader etc. How to solve this?
I use default Gmail iOS App/Safari for opening opening mails (It's a gmail server)
As Petesh menions, your server is not serving the file a mime type of application/vnd.apple.pkpass.
If using Apache, try adding the following to your .htaccess file or server .conf
AddType application/vnd.apple.pkpass .pkpass
If you are generating the .pkpass files manually, you can set the content header when serving the file. E.g. for PHP you can use:
header('Content-Type: application/vnd.apple.pkpass');
Related
I am using Drupal site (with .htaccess and clean URLs which are working fine) within built-in PHP Development Server (run by: php -S localhost:8888) where in CMS I generate dynamically the XML file which I would like to expose, however when I am trying to open /foo/bar.xml the following error happens:
The requested resource /foo/bar.xml was not found on this server.
After investigation, it seems PHP built-in server assumes that all files containing a dot they must be the files in the local filesystem.
Is there any workaround for that?
According to PHP Built-in web server docs, to handle custom requests, you need to specify a "router" script (given on the command line) which returns FALSE, then the requested resource is returned as-is, otherwise the script's output is returned to the browser.
Using a Router Script
Here is simple example which handles requests for images, then display them, otherwise if HTML files are requested, it will display "Welcome to PHP":
<?php
// router.php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"])) {
return false; // serve the requested resource as-is.
} else {
echo "<p>Welcome to PHP</p>";
}
?>
Drupal 7 & 8
For Drupal 7 & 8, you can use .ht.router.php file, then run it as:
php -S localhost:8888 .ht.router.php
I have a custom .reg file, which is used to apply registry adjustments. Making it a download is causing Internet Explorer ad FireFox to treat it as a media file, or download it as an MP3?
Has anyone seen this before?
Figured it out. Needed to add MIME type support to my Apache Web Server:
Using the following configuration:
AddType text/plain .reg
I changed .htaccess to:
AddType text/text .reg
It did the trick for Firefox and IE. In IE I didn't even have to download the file. Clicking it sent it directly to the registry (after ample warnings). When I changed it to text/plain it appended .txt in Firefox.
Since I've installed LAMP stack on ubuntu server with apache2, I've been having a weird issue. Whenever I create a file called filename.html, it renders and displays on browser fine. But whenever I create file with extension .htm, it will prompt the browser (firefox) to save the file.
I've already looked into /etc/mime.types and /etc/apache2/mod-enabled/mime.load
And what's in these files for .htm extension?
Can you check what mime-type returned by the Apache? (via browser plugins/sniffer)
After that you will see the issue...
i am using ubuntu and i have a html page named first.html at home/sanu directory and i have apache2 installed and running.i want host this page through apache from my pc how can i do that. (My pc's IP is :218.248.80.51) .i have tried to access "http://218.248.80.51/sanu/first.html" but its not working(Google Chrome could not connect to 218.248.80.51) in my browser.plz help me.
By default Apache points to /var/www on ubuntu, it would required extra configuration to get it to point at your home directory. Try moving your html file there, then you should be able to access it through your browser at http://localhost/first.html
To host the page for public viewing you'd need to configure your pc's & router's firewalls correctly to allow port 80.
When I try to do a file('http://somewebsite.com') i get an error
"URL file-access is disabled in the server configuration"
I tried using ini_set('allow_url_fopen', 'On'); but that didn't work.
I'm using shared hosting. Any suggestions?
All I want to do is read the html source code of a website.
On php version>4.3.4 and <6, you can't set allow_url_fopen in your script. Try using curl instead.
If your hosting allows and reads custom .htaccess files, try putting the following line to a .htaccess at the root of your project:
php_flag allow_url_fopen on
and see if it has an effect...