FineUploader:上传到Amazon S3时,嘉实原最后修改日期嘉实、日期、FineUploader、Amazon

2023-09-11 10:09:40 作者:倾其所爱

我要上传的文件的最后修改日期发送到服务器。我有javascroipt片段来获得,使用FileApi( $(本).fineUploaderS3('的GetFile,ID).lastModifiedDate )。我想发送此信息时, uploadSuccess 终点叫,但我找不到这是回调适合我在活动|精细上传文档,我无法找到我能注入数据的方式。

I would like to send the last modified date of the uploaded file to the server. I have the javascroipt snippet to get that using FileApi ($(this).fineUploaderS3('getFile', id).lastModifiedDate). I would like to send this information when the uploadSuccess's endPoint is called, but I cannot find the callback which is right for me at Events | Fine Uploader documentation, and I cannot find the way I could inject the data.

这些提交的POST参数到我的服务器上载完成后,以S3: UUID 名称。我想在上次更改日在这里以某种方式注入。

These are submitted as POST parameters to my server when the upload finished to S3: key, uuid, name, bucket. I would like to inject the lastModified date here somehow.

选项2:

询问有关最后修改日期亚马逊的S3服务没有直接的帮助,因为上传的文件具有当前日期,而不是​​文件的原始日期。这将是巨大的,如果我们能自己的最后修改日期为上传的文件注入到信息的方式,S3将使用它来设置它FineUploader-> S3通信。

Asking the Amazon S3 service about last modification date does not help directly, because the uploaded file has the current date, not the file's original date. It would be great if we could inject the information into the FineUploader->S3 communication in a way that S3 would use it for setting it's own last modified date for the uploaded file.

其他的角度来看,我认为:

Other perspective I considered:

如果我用的onsubmit setParams 然后我在亚马逊S3服务器将会把它作为X-amz-元上次更改时间。问题是,当我上传大文件(上传的数据块与其他舞蹈),然后我得到签名错误。 ...< code取代; SignatureDoesNotMatch< / code><消息>我们计算请求签名不您提供的签名相匹配。检查你的密钥和签名方法< /消息> ...

If I use onSubmit and setParams then I the Amazon S3 server will take it as 'x-amz-meta-lastModified'. The problem is that when I upload larger files (which is uploaded in chunks with an other dance) then I get signing error. ...<Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>....

修改

在其他角度来看,我认为的工作。瓶颈是自定义元数据芷我曾经在 setParams 的名称。它不能包含大写字母,否则签约失败。我没有找到任何的参考文档。对于一个我查对象键和元数据 - 亚马逊简单存储服务 。如果有人能找到我引用我将包括在这里。

The Other perspective I considered works. The bottleneck was the name of the custom metadata chih I used at setParams. It cannot contain capital letters, otherwise the signing fails. I did not find any reference documentation for it. For one I checked Object Key and Metadata - Amazon Simple Storage Service. If someone could find me a reference I would include that here.

原来的问题(何时以及如何发送最后修改日期为服务器组件)保持。

The original question (when and how to send last modified date to the server component) remains.

(服务器是PHP。)

EDIT2

在选项2 的是行不通的,据我的研究,走到了最后修改后不能手动更改亚马逊S3。

The Option 2 will not work, as far my research went the "Last Modified" entry cannot be manually altered at Amazon S3.

推荐答案

如果该S3 API不会返回预期的最后修改日期,你可以检查的值 lastModifiedDate 文件与上传相关联的对象(只要浏览器支持的文件API),并发送该值作为参数传递给上传成功的终点。请参阅该 setUploadSuccessParams API方法的更多细节。

If the S3 API does not return the expected last modified date, you can check the value of the lastModifiedDate on the File object associated with the upload (provided the browser supports the file API) and send that value as a parameter to the upload success endpoint. See the documentation for the setUploadSuccessParams API method for more details.

 
精彩推荐
图片推荐