Uploadify上传任意文件到S3与正确的内容类型正确、类型、上传、文件

2023-09-11 10:13:10 作者:哇塞我得了帅癌

我需要能够上传任何文件类型,例如PDF和JPEG。 S3中要求的内容类型设置为上载的时间,或该文件将不会被正确送达

I need to be able to upload any file type, for example, both pdf and jpeg. S3 requires the content-type be set at the time of upload, or the file will not be served correctly

是否可以动态分配的内容类型,在调用onSelect回调或其他地方?

Is it possible to dynamically assign the content-type in the onSelect callback or elsewhere?

的内容类型在POSTDATA参数设置为uploadify(scriptData中老年uploadify版本)。现在我没有办法来设置,直到一个文件被选中。当文件被选中,我可以决定(主要是准确的)内容类型的文件扩展名。现在所有的文件被当作application /八位字节流,这使得他们pretty的没用。

The content-type is set in the postData parameter to uploadify (scriptData in older uploadify versions). Right now I have no way to set this until a file is selected. After the file is selected I could determine (mostly accurately) the content-type from the file extension. Now all files are served as application/octet-stream, which makes them pretty useless.

推荐答案

您可以通过对象复制到自己设置包括内容类型现有S3对象的元数据并指定新的数据。

You can set the metadata including content-type of an existing S3 object by copying the object to itself and specifying the new data.

 
精彩推荐
图片推荐