Unable to create/rename files with special character “(” (Open Parenthesis)

。_饼干妹妹 提交于 2019-12-06 11:36:05

问题


I have an issue while creating / renaming files in OneDrive for Business(Admin) through rest client(PostMan).

Can you guys point me where i can find the tutorial or any documentation that states any specific requirements / restrictions for creating / renaming a file.

Please find the below details of the request.

URL : https://graph.microsoft.com/v1.0/cloudfuze.co/users/{user_id}/drive/items/{parent_id}/children/{file_name}/content

Ex File Name : (test).jpg

Headers :

{
    Authorization:Bearer XXXXXXXXXXXXXXXX,
    Accept:application/json,
    Content-Type:application/json
}

回答1:


You can use the following notation to create files with parenthesis in name: https://graph.microsoft.com/v1.0/users/{user_id}/drive/items/{parent_id}/children('{file_name}')/content

For example: https://graph.microsoft.com/v1.0/me/drive/root/children('text(a).abc')/content




回答2:


Seems its some kind of bug. The only workaround I found is to upload a file with random name, then rename it using PATCH. Here's the article about restricted characters in filename: https://support.microsoft.com/en-us/kb/3125202



来源:https://stackoverflow.com/questions/41612670/unable-to-create-rename-files-with-special-character-open-parenthesis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!