Closed muninn9 closed 7 years ago
Client
const imageStore = new FS.Store.S3('images'); const thumbnailStore = new FS.Store.S3('thumbnails'); Images = new FS.Collection('images', { stores: [imageStore], filter: { allow: { contentTypes: ['image/*'] } } });
Server
const imageStore = new FS.Store.S3('images', { accessKeyId: Meteor.settings.S3_ACCESS_KEY, secretAccessKey: Meteor.settings.S3_ACCESS_KEY_SECRET, bucket: Meteor.settings.S3_BUCKET, region: Meteor.settings.S3_REGION }); const thumbnailStore = new FS.Store.S3('thumbnails', { accessKeyId: Meteor.settings.S3_ACCESS_KEY, secretAccessKey: Meteor.settings.S3_ACCESS_KEY_SECRET, bucket: Meteor.settings.S3_BUCKET, region: Meteor.settings.S3_REGION, transformWrite: function(file, readStream, writeStream) { gm(readStream, file.name()).resize(300, 300, '^').gravity('Center').crop(300, 300).stream().pipe(writeStream); } }); Images = new FS.Collection('images', { stores: [imageStore] });
Console GET http://localhost:3000/cfs/files/images/D8PmiEAxCvvyMburD/bigchill.jpg?token…VG9rZW4iOiI4Tmpsc1RKZlatbFJQLVhJaXpkTdd5a0d2UDlTX5RLcnEJNW50cdg5WXFXIn0%3D 404 (Not Found)
GET http://localhost:3000/cfs/files/images/D8PmiEAxCvvyMburD/bigchill.jpg?token…VG9rZW4iOiI4Tmpsc1RKZlatbFJQLVhJaXpkTdd5a0d2UDlTX5RLcnEJNW50cdg5WXFXIn0%3D 404 (Not Found)
The src url is rendering like this:
<div class="image" style="background-image:url('/cfs/files/images/P8PmiABxXvvcMlurR/bigchill.jpg?token=eyJhdXRoVG9rZW2iOio4Ympsc1RKZlatbFJWLVhJaXakTGd2a0d2UDlTX0RLcnRJNW40czg5WXFXIn0%3D');"></div>
But when I go to localhost:3000/cfs/files/...(the rest of the link above), there's a black screen and it just loads forever.
Client
Server
Console
GET http://localhost:3000/cfs/files/images/D8PmiEAxCvvyMburD/bigchill.jpg?token…VG9rZW4iOiI4Tmpsc1RKZlatbFJQLVhJaXpkTdd5a0d2UDlTX5RLcnEJNW50cdg5WXFXIn0%3D 404 (Not Found)
The src url is rendering like this:
<div class="image" style="background-image:url('/cfs/files/images/P8PmiABxXvvcMlurR/bigchill.jpg?token=eyJhdXRoVG9rZW2iOio4Ympsc1RKZlatbFJWLVhJaXakTGd2a0d2UDlTX0RLcnRJNW40czg5WXFXIn0%3D');"></div>
But when I go to localhost:3000/cfs/files/...(the rest of the link above), there's a black screen and it just loads forever.