Reputation: 59
I want to check a page in Safari on IPhone. I have it in my mail box and want to save it and then open it in browser. But I cannot find any option to save this file in Iphone. I found a way to do the same thing on my Android phone by typing 'file://localhost/sdcard' in Chrome browser and then open the html file. Is there a similar way to save and view a file on Iphone? Please help!
Upvotes: 0
Views: 11760
Reputation: 4908
If the devices are on the same friendly WiFi network, spin up a Python server from terminal (in the directory containing the html file): python -m SimpleHTTPServer
Then, get computer's local ip using ifconfig
.
On the iPhone, would then go to http://<<computer's local ip>>:8000
for index.html
or http://<<computer's local ip>>:8000/<<filename>>.html
for any other file.
Examples:
http://192.168.1.2:8000/
http://192.168.1.2:8000/notindex.html
Upvotes: 1
Reputation: 3429
Once the page is opened on your iPhone all you have to do is tap the Sharing icon, middle icon on bottom, and select 'Add to Home Screen'
If you want to load an html file that you've created on you Mac to your iPhone you'll need to do the following. From System Prefs > Sharing > Enable Web Sharing. Place the html file in your ~/Sites folder. Go the the URL listed in the Web Sharing panel from your iPhone, while on the home network, and open the html file. It will load in Mobile Safari.
If you want this to stay on your iPhone you'll need to have the page written in html5 and have a properly setup CACHE MANIFEST. This includes the appropriate tag in the html file and have the proper manifest file. Then you can follow the first step and add it to your home screen and always have it on your iPhone.
Upvotes: 0