0

I have one URL which I launch in UIWebView and save the contents in Documents folder when user is online but when user is offline I take the content from document folder and show in UIWebView. So can anyone tell how to save html or aspx or jsp etc..contents in Documents folder and show in UIWebView in offline mode.

Marijn
  • 10,367
  • 5
  • 59
  • 80
Nuzhat Zari
  • 3,398
  • 2
  • 24
  • 36
  • please, check the following thread for the exact solution: [http://stackoverflow.com/questions/992348/reading-html-content-from-a-uiwebview](http://stackoverflow.com/questions/992348/reading-html-content-from-a-uiwebview) – holex Jul 17 '12 at 08:25
  • This will help if my page is html what if it is aspx or any other?Will this also work? – Nuzhat Zari Jul 17 '12 at 08:47
  • you should know you **cannot** save any server-side contents, I mean source codes of PHP or ASPX or JSP or etc... the webviews (or browsers) always provide a simple text to the client-side because the source-codes are being compiled and ran on the server-side and the server gives us plain text output only. only one thing you can get: the javascripts, because they are client-side contents, and they are being ran by the browsers. – holex Jul 17 '12 at 09:02
  • And I am not able to save images of html page using the methods in above link. – Nuzhat Zari Jul 17 '12 at 09:19
  • it is true, you have to download the images one by one using their link and for it you might use the `NSStream` class and I won't mention that you must change the image's links in the saved HTML source for the offline browsing... this is not just a simple HTML content saving as it seems for now. – holex Jul 17 '12 at 09:50

0 Answers0