Frame load interrupted error while loading a word document in UIWebView - iphone

I want to load a word document using UIWebView. I used the code provided in
http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html
to load the document.
But not all the documents load successfully. Sometimes I get an error
Error Domain=WebKitErrorDomain Code=102 UserInfo=0x145bc10 "Frame load interrupted"
The error seems to be very sporadic and I get this error only for some documents.
However the same document loads correctly in mail.app.
What am I missing?

The reason was, the file I tried to load doesn't contain a extension.
I was purposely removing the file extension (.doc and .ppt) which I think confused the UIWebView. Seems like iPhone ignores the OS 9 legacy typecodes completely. :)

I submitted a Radar regarding this issue. It's resolved in the latest version of iPhone OS 4.0.
http://openradar.appspot.com/radar?id=381401

Related

WOPI corrupting files on edit

I have a WOPI host running in a Blazor server application with all of the .wopitest tests passing for the desired functionality (others skipped).
When I upload a word document, I am able to view the document with no issues. I am also able to edit the document, however when I try and edit the document a second time, I get an error.
The error doesn't appear to be handled and seems to originate in the Office online javascript file.
Error on attempting second edit
Following the error, I am still able to open the document for viewing. It is the same behaviour if I use the 'Editing' button in the Office Online page or directly navigate to the editing page using an edit action url.
Supplementary information:
Using ngrok to debug locally
.NET 6
Using SQLite database for holding file information (including path to file)
Using local folders for storing file contents (e.g. 'data' folder containing all files)
Similar issues with .xslx files beign corrupted upon editing and requiring a 'repair' when opened with Excel. This repair removes cells containing text and indicates that it removes the theme.
Viewing a word document gives the following console errors View document error
The first editing of a word document gives the following console errors Edit document error
I was expecting to be able to repeatedly edit the document.
I tried opening the file in the Desktop version of Word and got the following error Desktop Word recover
Following a recover, the document appears to work as expected in Word (desktop) but still won't open for editing through WOPI.
Turns out it was the way the POST http request body was being saved.
Still not certain what was going wrong but somewhere along the way of writing the stream into a buffer and then saving that to a file corrupted the file.
I suspect the file stream was either truncating or adding a few bytes.
The interesting part being that Office Online was still able to view the file.
This indicates there is some tolerance for malformed files still being served.

Failed to display UIWebView to display docx/xlsx file with SFUZipEndOfCentralDirectoryError error with custom URL

We are writing some program to display documents on iOS. I think that there are a lot of confusion on the web about what type of documents which iOS UIWebView could display. Generally people refer to Technical Q&A QA1630 Using UIWebView to display select document types to see that all the MS office 07+ files (such as docx, xlsx, pptx) could not be displayed, however actually that is not what we see from testing. Actually we are able to display docx/xlsx/pptx document at UIWebView either loading from a remote URL, local file or in memory (loadData, here the baseURL can not be nil on simulator, see this link). Of course We are testing on latest version of iOS on iPhone simulator, it might be that the support was not at older iOS. At this point, We don't know that yet. If you know, please let me know.
However right now, We have one issue to display document at UIWebView by using custom URL for security reason. I did the custom URL by following the code here: protecting iOS resource. We could display xls, doc, ppt, pdf file, but not docx/xlsx/pptx, We got some error like this:
EXCEPTION SFUZipEndOfCentralDirectoryError: Could not find the end of central directory record
We tried to debug and could not figure what's to do here. Do you see similar error here? Could anyone shed some lights on this? Thanks very much.
It looks like the document you're trying to open might be corrupt. docx, xlsx, and pptx files are actually zip files containing a bunch of XML documents and other data. Check if you are able to uncompress the file on your computer by renaming it to .zip and then unzipping.

Uploading and Playing large videos. HttpRuntime tag settings Combination. Asp.net4.0 , C#

net page to upload a large file and a generic handler to play these large wmv video files of size which can be upto 150 MB's. I have the file content stored in varbinary type in SQL Server 2005.
I have set following settings in httpRuntime in web.config
<httpRuntime executionTimeout="110"
maxRequestLength="2097151"
requestLengthDiskThreshold="2097150"
shutdownTimeout="600"
delayNotificationTimeout="400"/>
The problem is that sometimes my files doesnt play. It get uploaded properly but when playing the request seems to get timeout. I was able to play files upto 100 MB's. It works 9 out of 10 times on local and production but why does it fails sometimes. The same file get played in one instance but on other instance it doesnt. Can anybody suggest where the problem may be. I think there must be some combination of httpRuntime attributes which i am missing. Please suggest. Its a production issue which keeps popping up.
why don't you use IHttpHandler? try this Uploading FIle Using IHttpHandler Might be there will be better solutions to use IHttpHandler if you will search for it.

UIWebView "Unable to read document" error

I am trying to open Word and Excel 2003 docs using loadRequest and I am getting this error
(in simulator).
Unable to Read Document.
An error occurred while reading the document.
According to this link,
http://developer.apple.com/library/ios/#qa/qa2008/qa1630.html
UIWebView should display doc and xls types.
Any ideas?
Are there any other recommended xls, doc viewers out there?
Thanks.
The reason i found int these case was due to password protected or encrypted file,or any file format which webview can load.
UIWebView has these EXCEPTION SFUZipEndOfCentralDirectoryError: Could not find the end of central directory record when it encounter with above reason.
You can load document like this

iPhone MoveMe Example - trouble with DisplayStrings

I'm starting to play a bit with iPhone applications and I downloaded the MoveMe example from the apple web page.
I managed to run the app, however I do not get the strings displayed. I noticed that the DisplayStrings.strings file, although it exists in the app folder, does not appear as one of the resources.
I tried adding it as a resource, but then after compiling I get an error saying "copystrings failed with exit code 1". I cannot find anything online regarding what the origin of this problem is...
The file itself is in utf16 (big endian), and contains simply a list of strings separated by new lines.
Any ideas?
Thanks.
I was having the same problem and as a workaround I renamed DisplayStrings.strings to DisplayStrings.data and added it as a resource. I then modified init in PlacardView.m to use the new filename. This made Xcode happy.
I fixed this by adding the DisplayStrings.strings file as a resource. However, when you do this it defaults the type to 'text.plist.strings' which is incorrect, since the file is just text. So, right click on the DisplayStrings.strings file in resources and change the type to 'text'. This solved the problem for me.