Images are got uploaded in the assets folder but it's not visible in the UI. When I restart the server then I could see the image.
Problem: Images are only getting stored in the assets but has not stored in the .tmp
file.
When restarting server the .tmp
reads all the files which are in the assets folder, but it is not happening while uploading image.
This is the situation which I am facing.
This is the code i tried to solve it with:
var file = req.file('logo');
file.upload({ dirname: '../../assets/images' }, function onUploadComplete (err, files) {
if (err) {
console.log("something went wrong") ;
} else {
console.log("File has uploaded successfully");
}
});
The reason you are seeing the file after the server is restarted is because of the grunt task copying the assets into the .tmp folder. So there are a few things you may want to do to fix your issue:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.