上载到my_documents或my_photos文件夹OneDrive [英] Upload to my_documents or my_photos folder OneDrive
问题描述
我可以使用URI上的PUT请求将其上传到OneDrive的顶级目录中.
I can upload to the top level directory in OneDrive with a PUT request at the URI:
如果知道特定的ID,我可以上传特定的文件夹
I can upload a specific folder if I know it's specific ID:
但是如何使用友好名称(例如,我的照片. OneDrive文档没有帮助-似乎掩盖了这一点.它提到了友好名称,但我不知道如何将其用作URI PUT请求的一部分.
But how do I upload to a folder using it's friendly name, e.g. my_photos. The OneDrive documentation isn't helpful - it seems to gloss over this. It mentions friendly names, but I don't know how to use them as part of a URI PUT request.
https://msdn.microsoft.com/en-us/jj680723使用具有友好名称的GET进行显示,但是PUT呢?我不知道.
edit: https://msdn.microsoft.com/en-us/jj680723 shows using GETs with friendly names, but what about PUTs? I can't figure it out.
谢谢
推荐答案
您应该可以将PUT对准与GET使用的基本URL一起上传到特殊文件夹",但添加"/files"除外就像处理普通文件夹一样.因此:PUT https://apis.live.net/v5.0/skydrive/my_photos/files/foo.jpg
You should be able to upload to a 'special folder' by aiming your PUT at the same base URL you use for GETs, except with "/files" added on, like you do for normal folders. So: PUT https://apis.live.net/v5.0/skydrive/my_photos/files/foo.jpg
也就是说,我们建议您考虑改用新的OneDrive API .它比您现在正在使用的功能更强大,并且文档记录更好.以下是特殊文件夹和
That said, we recommend you consider using the new OneDrive API instead. It is more powerful and better documented than the one you're using now. Here are the sections on special folders and uploading files. In the new API, the upload I mentioned above would look like PUT https://api.onedrive.com/v1.0/drive/special/photos:/foo.jpg
这篇关于上载到my_documents或my_photos文件夹OneDrive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!