Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 807655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:26:09+00:00 2026-05-15T00:26:09+00:00

I want to view .doc, .docx, .rtf, .ppt file in iphone. But I guess

  • 0

I want to view .doc, .docx, .rtf, .ppt file in iphone.

But I guess something is going wrong at my side and its not working for the above formats but my code is working fine for .txt and .pdf files.

I have the read the document regarding Webview it states it supports viewing of the above document.

below is my snippet for .doc

[webView loadData:requestData MIMEType:@"application/msword" textEncodingName:@"UTF-8" baseURL:nil];

for .ppt I am using MIME type as "application/vnd.ms-powerpoint"

Note: If I am making MIME type as “text/html” for .doc/.rtf then it displays some garbage data So I think there is something missing in MIME type from my side.

Any help is highly appreciated.

Waiting for your reply.

Update:……..

It seems there is some issue with NSData for opening these type of file formats.
My data is encrypted so I cannot use
requestWithURL directly and other thing is I need to pass credentials to get the file and the credentials doesnt work proplerly if I save the credentials using

[[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:credential
                                        forProtectionSpace:protectionSpace];

and then make the request using below

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]] ]

Is there any way I can use NSData for the above formats so that I can make async call and pass my credentials and then decrypt the data and show it in WebView.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:26:10+00:00Added an answer on May 15, 2026 at 12:26 am

    Not all of those formats (docx) are supported. This looks like the official word. In the example Apple does not specify a mime type.

    This question suggests that you must use an NSURLRequest instead of loadData.

    Edit:

    As far as I have seen, you cannot directly pass data to loadData for these types.

    The easy work around is to write to a temporary file. You can delete it in webViewDidFinishLoad or, technically, as soon as the the file has been opened.

    The hard work around is to use NSURLCache. You should be able to implement a custom NSURLCache and have WebKit use it via setSharedURLCache. Your cache would basically know how to get your local encrypted files and pretend that they are cached. I have not tried this, but I think it is your best bet. This approach may be blocked just like loadData is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i store doc file into sql server data base i want view this file
I want to export a page to a .doc file but when I open
I use below code to open .doc file by call other application. But I
I want to get a doc* in dlg class, and i know in view
I have a file say xyz.doc .I want to find the parent /Parents of
I have a doc file on sdcard. I want to open it in read-only
I have two views, both under the NavigationController. I don't want View 1 (on
I want to view the stream of the RGB data color stream on an
i want a view with UITabBAr at The bottom with some buttons+Navigation controller on
I want to view the nfs shares that are exported on a windows server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.