I organize sendFile functions in includes.js. They will be called while creating new advert. But the problem is server could not yet receive the sending files, so it generate error N°500.