是否可以使用Office 365在线打开存储在Azure上的文档?

时间:2016-06-07 16:05:52

标签: php azure azure-storage azure-storage-blobs office365api

我正在使用PHP将文件复制到Azure服务上。是否可以生成一个链接,允许用户使用Office 365在线自动打开此存储的文档?目前,返回URL将存储的文档下载到用户本地存储。这是我的PHP代码,它使用Microsoft Azure PHP SDK。

val df = sqlContext.createDataFrame(
  rdd.map(r => Row(r._1, r._2)),
  StructType(Array(
    StructField("guid",IntegerType),
    StructField("peopleObjects", ArrayType(StringType))
  ))
)

1 个答案:

答案 0 :(得分:1)

默认情况下,Office 365无法打开存储在其他位置(不在Office 365中)的文件。但是,您可以尝试使用WOPI协议与Office Online集成。 WOPI协议使Office Online能够访问和更改存储在您服务中的文件。

另一种解决方法是您可以考虑将文件上传到Office 365.您可以参考下面的REST在线创建/上传项目到SharePoint:

POST: https://graph.microsoft.com/v1.0/me/drive/root/children
authorization: bearer {token}
content-type: application/json
{
"name":"filename.docx",
"file":{}
}

PUT: https://graph.microsoft.com/v1.0/me/drive/root:/RESTFei.docx:/content
authorization: bearer {token}
Content-Type: application/msword

<@INCLUDE *C:\Users\username \Desktop\test.docx*@>

有关使用Microsoft Graph进行开发的更多详细信息,请参阅here