-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iPhone 6 (IOS 10.2.1) Unable to Open ClosedXML generated XLSX files from Gmail.com #279
Comments
I don't have an iPhone, so I have no way to test this. If you can fiddle in the xlsx content and find the problem, I might be able to fix it. |
i just tried this, it works, how are you sending an email ? automated or manually ? |
As per http://stackoverflow.com/questions/43089200/error-message-main-error-message-reason-on-ipad-and-iphone-safari check your mime type. |
After viewing some of the StackOverflows on this issue, troubleshooting this problem beyond just setting attachment mime type and encoding is beyond my capacity at this time. Since I have hundreds of PCs and only 3 iPhones; and it works on PCs and Android devices just fine - I'll chalk it up to a iPhone/iOS incompatibility with ClosedXML XLSX files problem for now until someone figures it out how to make it a working feature. I tried various mime type and transfer settings for .NET email attachments. I tried Safari and the Gmail App, which both try to open the XLSX with Google Sheets - and fail with the error messages I described. I will monitor this thread in case anyone decides to tackle the problem and get it to work or until it is closed if no one is interested in solving the problem. Thanks! |
Edit your original post and make the code sample fully reproducible. Inserting comments where the email is sent isn't very helpful. Basically, I want to copy and paste your code and reproduce your result with almost no intervention. |
Also, have you opened and saved the file in regular Excel and then tried mailing it programmatically? |
Follow-up - I installed Excel on my iPhone and, if I access my Gmail through the Gmail App instead of Safari or Google Sheets, I can transfer the attachment to Excel and open it OK. The problem is probably related to Apple Safari and/or Google Sheets incompatibility with ClosedXML XLSX format. |
Some people posted in forums that the XLSX files are "fixed" when opened in MS Excel and then re-saved. I will prepare a minimal test app and post it. |
ok i can reproduce this now |
@igitur we might have to open bug with openxml guys, it seems Open XML SDK, for whatever reason, doesn’t explicitly set the PartName=”/xl/workbook.xml” part. This is why iOS devices can’t see the spreadsheet file. but when you save with excel it gets set |
i even tried the latest |
Well spotted, @Pyropace . Is this missing part in the |
@Pyropace I found a different cause for the problem: absolute paths in the .rels files. I attach 2 files. One should be broken on the iPhone and one should work. Only difference is in @Pyropace , @ajstadlin Please confirm whether you experience the same. Thanks to @parautenbach for his help with this. |
You're welcome @igitur! |
@igitur confirmed |
No feedback from @ajstadlin . Closing this. Must be a Safari bug, and any workaround would have to be in |
Hi @igitur - what type of feedback were you looking for from @ajstadlin? I have also had this same issue with all spreadsheets created through ClosedXML. I reviewed the two spreadsheets you attached and tried to open both on an iPhone without using Excel. The success file opens fine. The fail file provides the error messages and does not open. I manually modified the /xl/_rels/workbooks.xml.rels in the fail file, removing the "/xl/" from the URL's and then sent the file back to the iPhone and confirmed it could be viewed in ios. Is there any other way around this? Any other suggestions on a way to make the ClosedXML files viewable in ios without modifying the URL's in /xl/_rels/workbooks.xml.rels ? |
Nope, there's nothing we can do. ClosedXML is a wrapper around OpenXML and that uses A DOTNET library to package the contents. |
Thanks @igitur! It makes sense, and at least we understand where the issue lies. I appreciate the information! |
Sorry for the lack of feedback. Troubleshooting this issue is currently beyond my capacity. However, if the issue is solved by simply removing "/xl/" from "/xl/_rels/workbooks.xml.rels", I can simply do that by post processing the XLSX files after creating them and before sending them by email or text messaging - just in case one of my users has an iPhone device. Thank you for your great work on ClosedXML! |
@ajstadlin You might want to submit a bug with Apple too. It's definitely their bug. |
Has anyone made a workaround to mitigate this issue? |
If we use any other library like NPOI, etc. , will we face the same issue?? |
@igitur or @ajstadlin: any sample code available for what exactly you did to make the changes to the success.xlsx file that made it work vs. the fail.xlsx? I can confirm that success does indeed work for me on ios and fail does not, but I'm a little unclear on what was done - I searched my exported file for the string "/xl/_rels/workbooks.xml.rels" and it was not found, tho there were 5-6 occurrences of "/xl/" - should I just remove all of those? I hate blindly removing data from the file that might cause other issues for people down the line trying to view the files without understanding the file format. Can you elaborate on what the code might look like to do this post-processing step? Seems like it'd be a universally useful and generic snippet of workaround code. @vikasChauhan77: I can confirm that we had similar issues with NPOI, but the error message was slightly different - the "ERROR_MESSAGE_MAIN" was the same, but the reason was listed as "The operation couldn't be completed. (OfficeImportErrorDomain error 912.)". This was the main impetus behind switching to ClosedXML in the first place, but alas, we have run into the issue mentioned in this bug (though I also MUCH prefer ClosedXML's api :)). |
Sorry, I don't have code to fix it. I made the changes by hand. |
@igitur: Can you comment on the other questions that were asked?
|
@AZ2Tonez Here is the diff of the 2 versions: Left: successful opening of file on iPhone. Right: fail opening of file on iPhone. |
Requesting a feature
What is the current behavior?
When opening a ClosedXML XLSX file attachment from Gmail.com using Safari on iPhone 6 the following message is displayed in an https://mail-attachment.google.com... web page
Steps to reproduce:
What is the expected behavior or new feature?
iPhone should be able to open the XLXS file from a gmail attachment. No problems opening the XLSX file on a PC running LibreOffice.Calc or MSOffice.Excel. I do not want to install regular Excel on my iPhone. My iPhone opens XLSX files created with regular Excel OK. I only need the ability to View XLSX files on the iPhone, not edit them. ClosedXML files open OK on my Android phone.
Did this work in previous versions of our tool? Which versions?
Did not work in 0.80.x. Does not work in 0.87.x.
It would be really nice to have a ClosedXML feature that allows its files to be viewed by default iPhone viewer.
Thank you - and keep up the great work on this project!
//aj
The text was updated successfully, but these errors were encountered: