我正在使用 Rackspace 的 Cloud Files 产品,并且我已经成功地将文件放入我的容器中,但是,在测试期间,我发现文件没有设置 Content-Type。
关于如何使用 Java SDK 设置内容类型的示例,我已经看了很多,但没有运气。
我试过的:
Map<String, String> metaData = new HashMap<String, String>();
metaData.put("mime-type", content_type);
// or metaData.put("Content-Type", content_type);
Blob blob = storage.blobBuilder(file.getName())
.payload(file).userMetadata(metaData).build();
storage.putBlob(container, blob);
任何帮助,将不胜感激。