I have a meteor app that's live and running, and I tested uploading images on a desktop and they work fine. But When I try on my iphone's safari it crashes and reloads the page.
Is there a difference between the setup if you are uploading images from mobile? I am using Collection FS. Please note, this is not an IOS app, but rather uploading from the mobile browser.
Here's the relevant code
HTML
<div class="fileUpload btn btn-success btn-lg pull-right visible-xs visible-sm">
<span class=""><i class="fa fa-camera"></i></span>
<input type="file" class="myFileInput" accept="image/*" />
</div>
CLIENT SIDE
'change .myFileInput': function(event, template) {
var user = Meteor.user();
var files = event.target.files;
var fsFile = new FS.File(files[0]);
fsFile.username = user.username;
var newImage = Images.insert(fsFile, function(err, response, fileObj) {
if (err) {
console.log(err)
} else {
console.log('success');
}
});
}
SERVER SIDE
var profileThumbsStore = new FS.Store.S3('thumb', {
accessKeyId: Meteor.settings.key,
secretAccessKey: Meteor.settings.secret,
bucket: Meteor.settings.bucket,
folder: 'thumb',
transformWrite: function(fileObj, readStream, writeStream) {
gm(readStream, fileObj.name()).resize("100", "100").stream().pipe(writeStream);
}
});
var profileStore = new FS.Store.S3('original', {
accessKeyId: Meteor.settings.key,
secretAccessKey: Meteor.settings.secret,
bucket: Meteor.settings.bucket,
folder: 'original',
transformWrite: function(fileObj, readStream, writeStream) {
gm(readStream, fileObj.name()).resize("500", "500").stream().pipe(writeStream);
}
});
Images = new FS.Collection('images', {
stores: [profileStore, profileThumbsStore],
filter: {
// maxSize: 1048576, // in bytes
allow: {
contentTypes: ['image/*'],
},
onInvalid: function (message) {
if (Meteor.isClient) {
sAlert.error(message);
} else {
sAlert.success(message);
}
}
}
});
Like I mentioned, it's working properly on desktop, so I don't understand why it wouldn't work for an iphone.
Any help would be appreciated.