1

I have tried to open (using loadData/loadRequest methods of webview) the password protected files in my web view controller. I can open the password protected pdf and zip files. it works fine. But When I tried to open the other password protected files it shows the error.

(unable to read document).

If i have tried to open that file in Safari, there also i am getting the same error. But It works fine in iPad mail native app.

Please guide me. What is problem ?

Whenever i have tried to open the password protected pdf/ppt files , it return below EXCEPTION

**EXCEPTION SFUZipEndOfCentralDirectoryError: Could not find the end of central directory record**
Geet
  • 2,427
  • 2
  • 21
  • 39
Finder
  • 8,259
  • 8
  • 39
  • 54

2 Answers2

1

You can't open password protected zip or pdf until unlock it.

CGPDFDocumentUnlockWithPassword(doc, pass).

i have not tried this but i hope this will help for you.

  • Thanks Sanjay.Pdf and zip no problem. It works fine. When I have tried to open .xlsx/.docx files, those could not open. – Finder Dec 16 '14 at 11:48
1

Through UIWebView , we cannot open any password protected files except PDF. If you want to open the password protected files, use QLPreviewcontroller. It will work perfectly

Finder
  • 8,259
  • 8
  • 39
  • 54
  • QLPreviewcontroller does work well, however, it seems that QLPreviewcontroller does not support developers customise user interactions. For example, if I want pop an alert if I touch the screen. I do not how to monitor the user touches. – yeyimilk Aug 17 '16 at 00:38