Hi! I use ostrio:files for loading images on server. This package loading images for patch “.meteor/local/build/programs/server/assets/app/uploads/Images/”.
I want use this path to upload image, instead of the public directory
add_image.js
'change #fileInput': function (e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
file = e.currentTarget.files[0];
if (file) {
var uploadInstance = Images.insert({
file: file,
streams: 'dynamic',
chunkSize: 'dynamic'
}, false);
uploadInstance.on('start', function() {
template.currentUpload.set(this);
});
uploadInstance.on('end', function(error, fileObj) {
if (error) {
alert('Загрузка не удалась: ' + error.reason);
} else {
//file link
imagesURL = '.meteor/local/build/programs/server/assets/app/uploads/Images/' + fileObj._id+ '.png';
console.log(imagesURL);
alert('Файл ' + fileObj.name + ' загружен!');
return imagesURL;
}
template.currentUpload.set(false);
});
uploadInstance.start();
}
}
}
post.html
<template name="openPost">
<div class="post">
<div class="post-content">
<h2><strong>{{titlename}}</strong></h2>
<br>
<h3>{{categore}}</h3>
<br>
<img src="{{image}}" alt="{{image}}">
<br>
<div class="col-sm-12" id="BorderPost">
{{posttext}}
<br>
<br>
<a href="" id="deletepost">Удалить пост</a>
</div>
</div>
</div>
</template>
This method does not work