1

I am using slingshot to upload some images in my Amazon s3 and it works like charm. Nevertheless, I want to use slingshot to upload some files (text,doc,odf etc) too in my Amazon s3. BUT, I want to convert all these files into PDF first before uploading into s3. I am familiar with nodeJs package like "https://github.com/gfloyd/node-unoconv", that converts file into PDF. But how would i be able to integrate it into slingshot.

Eventually all the text, doc, etc files, that the client uploads, I want them to be stored in S3 but in PDF format. So is there any way to do that.

Amateur in meteor, so would be grateful if the explanation is detailed.

Thanks.

4

1 に答える 1

2

Slingshot は S3 に直接アップロードしているため、アップロード前にファイルを効率的に変換する方法がわかりません。クライアント側で行うこともできますが、これは明らかに 100% 信頼できるわけではなく、クライアントにとって負担になる可能性があります。

最近のアプリケーションでは、画像が S3 バケットにアップロードされるとすぐにサイズ変更を行うためにAmazon Lambdaを使用しました。

使い方はとても簡単です。コードを含むパッケージを作成して Lambda にアップロードし、ファイルが S3 にアップロードされたときに Lambda 関数をトリガーするだけです。

このサービスは非常に安価で、チュートリアルに従うのは簡単です。これはファイルのサイズ変更に関するものですが、任意の npm パッケージを使用できるため、PDF 変換を行うために簡単に変更できるはずです。S3 バケットの作成、IAM ロールの作成、Lambda 関数の作成など、多くの手順が必要ですが、構成が完了するとすぐに、非常に信頼性が高くなります。

特にバケットに直接アップロードする場合は、S3 と組み合わせるのに最適なツールだと思います。

于 2015-06-25T08:19:38.740 に答える