-
-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cant show inserted image #66
Comments
picture is uploaded server: Meteor.Files Debugger: [MeteorFileWrite] {name: K8g3CxveXuPCswMhQ, meta:[object Object]}
I20160409-22:51:54.725(2)? Meteor.Files Debugger: Received chunk #1 of 1 chunks, file: dance-icon.png
I20160409-22:51:54.802(2)? Meteor.Files Debugger: [MeteorFileWrite] {name: K8g3CxveXuPCswMhQ, meta:[object Object]}
I20160409-22:51:54.802(2)? Meteor.Files Debugger: Received chunk #-1 of 1 chunks, file: dance-icon.png
I20160409-22:51:54.811(2)? Meteor.Files Debugger: The file dance-icon.png (binary) was saved to ~/interests/K8g3CxveXuPCswMhQ.png on the client: Meteor.Files Debugger: [insert()]
files.coffee:878 Meteor.Files Debugger: Connection established continue() upload
files.coffee:884 insert: 121.977ms |
Have you subscribed to this data? Please see this example |
Also you need to change template to: {{#if currentFile}}
Uploading <b>{{currentFile.file.name}}</b>:
<span id="progress">{{progress}}%</span>
{{else}}
<input id="fileInput" type="file"/>
{{/if}}
<hr>
{{#if imageFile}}
<img src="{{fileURL imageFile}}" alt="{{imageFile.name}}"/>
{{/if}} |
server Meteor.publish('files.images.all', function () {
return InterestIcons.collection.find({});
}); client Router.route('/interests/new', {
name: 'newInterest',
waitOn: function () {
return [Meteor.subscribe('InterestType'),Meteor.subscribe('files.images.all')];
}
}); |
Does my comment about template fix this issue? |
unfortunately no .. looks better I20160409-22:58:32.321(2)? Meteor.Files Debugger: [findOne("Azyz5KMzneroddsWW")]
I20160409-22:58:32.322(2)? Meteor.Files Debugger: [download(/cdn/storage/InterestIcons/Azyz5KMzneroddsWW/original/Azyz5KMzneroddsWW.png, original)]
W20160409-22:58:32.324(2)? (STDERR) Meteor.Files Debugger: [download(/cdn/storage/InterestIcons/Azyz5KMzneroddsWW/original/Azyz5KMzneroddsWW.png)] [404] File not found |
but the image is in filesystem I checked it |
Okay, I saw from you previous issue, what you're using path relative to you user (starts with |
Or even try to keep package's default (for testing purpose) |
I have it but I didnt want to publish it ;) |
It works right know but It finds only one image but I want to display curently uploaded |
Then do something like: Template.uploadForm.onCreated(function () {
this.uploadedFile = new ReactiveVar(false);
});
Template.uploadForm.helpers({
currentFile: function () {
return Template.instance().currentFile.get();
},
uploadedFile: function () {
return Template.instance().uploadedFile.get();
}
});
Template.uploadForm.events({
'change #fileInput': function (e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
var file = e.currentTarget.files[0];
template.currentFile.set(Images.insert({
file: file,
onUploaded: function (error, fileObj) {
if (error) {
alert('Error during upload: ' + error);
} else {
// Two options
// First (no need for subscription):
template.uploadedFile.set(fileObj);
// Second (subscription needed):
template.uploadedFile.set(InterestIcons.collection.findOne({_id: fileObj._id}));
}
template.currentFile.set(false);
},
streams: 'dynamic',
chunkSize: 'dynamic'
}));
}
}
}); |
I'm off for today, will check you reply tomorrow |
I figured it out with similar implementation .. thanks a lot man :) |
Solved? Right? |
that's right .. thanks for your support :) |
hi,
I use thus code
and that in template helper
and cant see the uploaded image
Best regards
The text was updated successfully, but these errors were encountered: