This question follows on from a previous question that went unanswered.
I've got a requirement in an Azure web app to edit a Document, instead of:-
The client would like an experience similar to what you get in Sharepoint i.e.
One solution I've found is...
Store the Documents in a Azure File Share. Create a login script which would run on every windows client access to set the user name and password for the Azure File Share....
cmdkey /add:<storage_account>.file.core.windows.net /user:AZURE\<storage_account> /pass:<storage_account_key>
Use links in the html like...
<a href='file://///<storage_account>.file.core.windows.net/<storage_container>/test.docx'>Test.doc</a>
There's a number of issues with this.
Can anyone suggest alternative solutions?
Azure Blob storage is Microsoft's object storage solution for the cloud. Blob storage is optimized for storing massive amounts of unstructured data, such as text or binary data. Blob storage is ideal for: Serving images or documents directly to a browser.
To edit, click Edit Document in the top left corner and select Edit in Word Online. The document will then open in the editor and allow you to make changes to the document. To edit a document with Word on your desktop, select Edit in Word when in the Read Only version of your OneDrive document.
Options for editing MS Word documents in Azure Storage
To edit MS Word document online, That saving the Word document to OneDrive is a good choice. OneDrive will provide a link for the file which we uploaded and we could view and edit the file based on this link.
Here are the detail steps.
PUT https://graph.microsoft.com/v1.0/drive/root:/Documents/{filename}.docx:/content HTTP/1.1
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Authorization: Bearer {your token}
Accept: application/json
Host: graph.microsoft.com
Expect: 100-continue
Connection: Keep-Alive
Put your file content here
We can get the link for the file from the webUrl property of response JSON object. It is like this,
"webUrl": "https://1drv.ms/w/s!AI164yLtIBq0gSA"
For more information, link below is for your reference.
Simple item upload to OneDrive using PUT
POST /subscriptions
Content-Type: application/json
{
"notificationUrl": "https://xxxx.azurewebsites.net/api/webhook-receiver",
"expirationDateTime": "2018-01-01T11:23:00.000Z",
"resource": "/me/drive/root",
"changeType": "updated",
"clientState": "client-specific string"
}
For more information, link below is for your reference.
WebHooks - Adding a new subscription
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With