Comments (16)
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
from meteor-files.
Have you subscribed to this data? Please see this example
from meteor-files.
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}}
from meteor-files.
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')];
}
});
from meteor-files.
Does my comment about template fix this issue?
from meteor-files.
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
from meteor-files.
but the image is in filesystem I checked it
from meteor-files.
Okay, I saw from you previous issue, what you're using path relative to you user (starts with ~
)
Could you try to change it to absolute path?
from meteor-files.
Or even try to keep package's default (for testing purpose)
from meteor-files.
I have it but I didnt want to publish it ;)
from meteor-files.
It works right know but It finds only one image but I want to display curently uploaded
from meteor-files.
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'
}));
}
}
});
from meteor-files.
I'm off for today, will check you reply tomorrow
from meteor-files.
I figured it out with similar implementation .. thanks a lot man :)
from meteor-files.
Solved? Right?
from meteor-files.
that's right .. thanks for your support :)
from meteor-files.
Related Issues (20)
- What defines the filename of the saved file? HOT 2
- Async support HOT 23
- [FilesCollection.ServiceFile] Path "/assets/app/uploads/ServiceFileCollection" is not writable! HOT 2
- How to change item metadata before it is inserted into the collection? HOT 9
- How do I update a filesCollection after Server side Write created? HOT 1
- Get user ip on upload HOT 9
- Since Meteor 2.11 - Exception in setTimeout callback: TypeError: fs.remove is not a function HOT 9
- Question: Can you store directly in GridFS? HOT 2
- Question: Save link in database?
- Update aws-sdk to v3 in 'Use AWS:S3 As Storage' Documentation HOT 4
- Files.load -> options.fileName is not in filepath HOT 2
- FilesCollection.find(...).each() not working properly? HOT 1
- HTTP uploads not working, multi-instance/cluster environment NGINX balanced HOT 5
- onAfterUpload not throwing error in uploader.on('end') HOT 5
- Cannot stream a video with filenames longer than 80 characters HOT 1
- wrong custom error message when using HTTP
- Make Meteor-Files compatible with meteor-desktop? HOT 4
- Uncaught error when uploading an empty file
- Help Wanted: Method '_FilesCollectionAbort_attachments' not found [404] HOT 1
- Match error: Unknown key in field HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-files.