我们目前正在使用API进行文件上传和下载。
我们成功上传文件,但我们无法下载。我们发现有些文件包含' +'这个问题似乎是个问题。
我的问题是,如果我们这样调用API:
nameoffile = "testing+test"
https://sitename/api/filesystem/nameoffile
是否有其他方法可以调用API,以便客户端/浏览器按照我们需要的方式处理名称?
答案 0 :(得分:1)
是。你在谈论 URLEncoding 特殊字符:https://www.tutorialspoint.com/html/html_url_encoding.htm
在您的情况下,“+”字符编码为“%2B”:
nameOfFile = "testing%2Btest"
url = "https://www.google.com/abc/"+nameOfFile