Add support for Office 365 files (with word/document2.xml)
nocoli opened this issue · 2 comments
When I create a brand new Word online file and save (download) it to my PC and then try and open it with this library I get the following error:
No such file or directory - word/document.xml (Errno::ENOENT)
/var/task/vendor/bundle/ruby/2.5.0/gems/rubyzip-2.2.0/lib/zip/file.rb:397:in `get_entry'
/var/task/vendor/bundle/ruby/2.5.0/gems/rubyzip-2.2.0/lib/zip/file.rb:255:in `get_input_stream'
/var/task/vendor/bundle/ruby/2.5.0/gems/rubyzip-2.2.0/lib/zip/file.rb:287:in `read'
/var/task/vendor/bundle/ruby/2.5.0/gems/docx-0.4.0/lib/docx/document.rb:26:in `initialize'
/var/task/vendor/bundle/ruby/2.5.0/gems/docx-0.4.0/lib/docx/document.rb:50:in `new'
/var/task/vendor/bundle/ruby/2.5.0/gems/docx-0.4.0/lib/docx/document.rb:50:in `open'
/var/task/event.rb:87:in `stamp_docx_properties'
/var/task/event.rb:26:in `block in handle'
/var/task/event.rb:20:in `each'
/var/task/event.rb:20:in `handle'
Upon inspection of the docx file on my system it seems to have a word/document2.xml
file instead of a word/document.xml
file.
To replicate this blank docx file navigate to https://www.office.com/launch/word and create a blank document then save it to your local PC.
I am not sure why docx files created in word online have word/document2.xml
instead of word/document.xml
but could you please add support for this?
Can you share the document that you are using?
Certainly. I have created the attached document following the steps I mentioned above. Please let me know if there is any other information I can provide.