I have an issue with upload images on server and then show it on site. Backend is running in sailsjs + angular.js but templete where I show image is predefined and there is only js/html.
There are two case : 1 – all working as it should 2 – it not working as should
1) I upload image that size is to 107kb, it upload to server fully, application is not shutdown, image is showed in website
2) I upload image that size are more then 107kb, it upload to server full, application is restart with backend, one half of image are shown in the website (app is crashing).
Firstly I think that problem is with size, but I upload image without showing it on website and everything is working good. So the problem is with showing it. This is from logs of this error.
Error: write after end
at write_ (_http_outgoing.js:627:15)
at ServerResponse.write (_http_outgoing.js:622:10)
at ReadStream.ondata (_stream_readable.js:651:20)
at ReadStream.emit (events.js:180:13)
at ReadStream.emit (domain.js:422:20)
at ReadStream.Readable.read (_stream_readable.js:487:10)
at flow (_stream_readable.js:858:34)
at ServerResponse.<anonymous> (_stream_readable.js:719:7)
at ServerResponse.emit (events.js:180:13)
at ServerResponse.emit (domain.js:422:20)
at Socket.ondrain (internal/http.js:20:44)
at Socket.emit (events.js:185:15)
at Socket.emit (domain.js:422:20)
at onwriteDrain (_stream_writable.js:487:12)
at afterWrite (_stream_writable.js:475:5)
at onwrite (_stream_writable.js:468:7)
This code is for upload : here
And this code show image on website :
previewIframe.$('.js-asset img').attr('src', uploadedPath); // tmp path
from Image is not showing on website fully and it crash a server
No comments:
Post a Comment