0

I use Javascript REST api for Sharepoint in order to create files on my Sharepoint server and then open/edit them with Office Web. I am able to create new files on the server and it works fine, but I can't edit the files with Office Web. I noticed that When I create new docx files using the sharepoint site, the files has size ~19KB and I can edit them with Office Web, But when I create files using the REST api, the created files are empty (0KB) and I cannot edit them with office web (Office Web says "Sorry,this document cant be opened for editing"). It seems to me that I need somehow to fill the empty files with the content of an empty editable docx file and then I will be able to edit them with office web.

I searched all over the internet about this problem but i didn't find something useful.

Thanks,

0

Sadly, there is currently (as of 1/17) no extension in the OneDrive REST api to create office documents (wish there was as I have the same issue). There are however, a few third party javascript libraries that will create the file for you, the trick is that you're right an empty office file is really not 0kb, it's somewhat bigger because the .docx is the Office Open XML format is really just a zip file. Unless you want to try and disassemble and recreate that i'd suggest finding a third party library where someone has already done that heavy lifting. I'm not working with DOCX, so I have no recommendations to make, maybe someone else can chime in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.