Amazon S3密钥中的特殊字符? [英] Special chars in Amazon S3 keys?

查看:416
本文介绍了Amazon S3密钥中的特殊字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

键中是否可以包含åäö这样的特殊字符?如果我在存储密钥之前对密钥进行了编码,但是我真的找不到访问该对象的方法.如果我在URL中写åäö,我将被拒绝访问(就像我在未找到对象的情况下得到的一样).如果我对我粘贴到浏览器中的URL进行了urlencode,则会显示"InvalidURIConot't parse the指定的URI".

Is it possible to have special characters like åäö in the key? If i urlencode the key before storing it works, but i cant really find a way to access the object. If i write åäö in the url i get access denied (like i get if the object is not found). If i urlencode the url i paste in the browser i get "InvalidURICouldn't parse the specified URI".

有什么办法吗?

推荐答案

Amazon支持带有Unicode字符的键名.将文件上传到Amazon时,您不需要URL编码密钥名称.生成下载URL时,确实需要对密钥名进行URL编码.

Amazon supports key names with Unicode characters. You do not need to URL encode the key name when you upload a file to Amazon. You do need to URL encode the key name when you generate a download URL.

如果将名为åäö.txt的文件上传到名为mybucket的存储桶中,则下载URL将为

If you upload a file named åäö.txt to a bucket named mybucket, the download URL will be http://mybucket.s3.amazonaws.com/%C3%A5%C3%A4%C3%B6.txt

如果使用.NET,则.NET的SprightlySoft S3组件具有轻松生成下载URL的功能,并且完全支持键名中的特殊字符.在sprightlysoft.com上尝试一下

If you are using .NET the SprightlySoft S3 Component for .NET has a function to easily generate a download URL and it fully supports special characters in key names. Give it a try at sprightlysoft.com

这篇关于Amazon S3密钥中的特殊字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆