{"id":344984,"date":"2023-02-05T15:00:14","date_gmt":"2023-02-05T15:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=344984"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=344984","title":{"rendered":"<span>\u0417\u0430\u0441\u044b\u043b\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0438\u0437 Unreal Engine \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432 \u0442\u0435\u043b\u0435 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0440\u043e\u0431\u0430 \u043f\u0435\u0440\u0430, \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043e\u043c, \u043f\u0430\u0440\u0434\u043e\u043d\u044c\u0442\u0435.<\/p>\n<p>\u0414\u0430, \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043c\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u043d\u0430 \u0444\u043e\u0440\u0443\u043c\u0435 EpicGames, \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/dev.epicgames.com\/community\/learning\/tutorials\/R6rv\/unreal-engine-upload-an-image-using-http-post-request-c\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043b\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 UE \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0443 \u0434\u0432\u0438\u0436\u043a\u0430 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u0442. \u0427\u0442\u043e \u0436, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0431\u043b\u0430\u0433\u043e, \u044d\u0442\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0438\u0433\u0440\u0443\u0448\u0435\u0447\u043d\u044b\u0439, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438, \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0431\u0443\u043c\u0430\u0433\u043e\u043c\u0430\u0440\u0430\u043d\u0438\u0435 \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 C++ \u0432 Unreal. \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0434\u043b\u044f \u0434\u0430\u043b\u0435\u043a\u0438\u0445 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043b\u044e\u0434\u0435\u0439 (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u044f).<\/p>\n<h2>\u0421\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p> \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u0432 back-end, \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/github.com\/RadAlex\/express-upload-template\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u0435<\/a>.<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0430\u043c \u043f\u0430\u043f\u043a\u0443, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>git clone https:\/\/github.com\/RadAlex\/express-upload-template.git<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/nodejs.org\/\" rel=\"noopener noreferrer nofollow\">node js<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 (\u0438\u043b\u0438 \u0432 VS code terminal) \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm install<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run start <\/code>\u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 <a href=\"http:\/\/127.0.0.1:3000\/upload\" rel=\"noopener noreferrer nofollow\"><strong>http:\/\/127.0.0.1:3000\/upload<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u0444\u043e\u0440\u043c\u0435, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Browse, \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Upload<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>\/public<\/code><strong><em>, <\/em><\/strong>\u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c:<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (<code>include<\/code> \u0432 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0435 \u0421++).<\/p>\n<p>\u0422\u0430\u043c \u0436\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u043f\u043e\u0440\u0442\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435, endpoints, \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 HTTP \u0431\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e GET \u0438 POST.<\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, GET \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>app.get(\"\/\", function (req, res) { \u00a0res.send(\"Hey!\");});<\/code><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>http:\/\/127.0.0.1:3000\/<\/code> \u0442\u043e \u043e\u043d \u0432\u0435\u0440\u043d\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u201cHey!\u201d.<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/85a\/2dd\/a03\/85a2dda030062951b2d34943f136025e.png\" width=\"425\" height=\"124\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/85a\/2dd\/a03\/85a2dda030062951b2d34943f136025e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0438\u0436\u0435 \u0443\u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435 \u0442\u0435\u043a\u0441\u0442, \u0430 HTML \u0444\u0430\u0439\u043b, upload.html<\/p>\n<p><code>app.get(\"\/upload\", function (req, res) {<\/code><\/p>\n<p><code>\u00a0 res.sendFile(path.join(__dirname, \"\/public\/upload.html\"));<\/code><\/p>\n<p><code>});<\/code><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/598\/f1a\/5c9\/598f1a5c9d6de8f7f766ee59d880d705.png\" width=\"444\" height=\"176\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/598\/f1a\/5c9\/598f1a5c9d6de8f7f766ee59d880d705.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u00a0<\/p>\n<p>Endpoint \u0434\u043b\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b app.post().<\/p>\n<p>app.post(&#171;\/upload&#187;, async function (req, res) {\u2026 }).<\/p>\n<p>\u041f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435, \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 req.files (\u0432\u0435\u0434\u044c \u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e).<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u044f \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/p>\n<p><code>const uploadedFile = req.files.uploadFile.<\/code><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u0443\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f (\u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e uploadedFile.name):<\/p>\n<p><code>const uploadPath = __dirname + \"\/public\/\" + filename;<\/code><\/p>\n<p>\u0418 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 mv :<\/p>\n<p>\u00a0\u00a0\u00a0 <code>uploadedFile.mv(uploadPath, function (err) {\u2026})<\/code><\/p>\n<p>\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p><code>app.listen(PORT, () => {<\/code><\/p>\n<p><code>\u00a0 console.log(app is running on PORT ${PORT});<\/code><\/p>\n<p><code>});<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u044b \u0442\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c.<\/p>\n<h2>Unreal<\/h2>\n<p>\u041a\u043e\u0434 \u043f\u0438\u0441\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 4.27.2, \u043d\u043e \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0432 5\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.<\/p>\n<p><a href=\"https:\/\/dev.epicgames.com\/community\/learning\/tutorials\/ZdXD\/call-rest-api-using-http-json-from-ue5-c\" rel=\"noopener noreferrer nofollow\">\u0422\u0443\u0442 <\/a>\u0438 <a href=\"https:\/\/benui.ca\/unreal\/http-post\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442 <\/a>\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f MimeUpload, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438.<\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 GameModeBase, \u0447\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u0433\u0443\u0442, \u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b. \u0412\u0435\u0434\u044c \u044d\u0442\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u0442\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0445 \u0432\u0435\u0449\u0435\u0439, \u0438 \u0447\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u043c\u0443, \u0442\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0443\u0441\u0432\u043e\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0432\u0430\u043c \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u043d\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e <s>\u0431\u0440\u0435\u0434\u043e\u043c<\/s> <s>\u043d\u0430\u0433\u043b\u043e\u0439 \u043b\u043e\u0436\u044c\u044e<\/s> \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c\u0438, \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c:<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 (\u0421++ \u0438\u043b\u0438 blueprint, \u043d\u0435 \u0432\u0430\u0436\u043d\u043e)<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0421++ \u043a\u043b\u0430\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b (<strong>File-> Add new C++ class<\/strong>)<\/p>\n<p>\u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435, \u043c\u043e\u0439 \u043d\u043e\u0441\u0438\u0442 \u0443\u0436\u0430\u0441\u043d\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f: <strong>MyGameModeBase<\/strong><\/p>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 (\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u044f\u043c\u043e \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 GameMode), \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c SCREENSHOTS_API \u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0432\u0441\u0435 \u0431\u0443\u043a\u0432\u044b \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0435), \u00a0\u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 <strong>AMyGameModeBase<\/strong> \u043d\u0430 \u0441\u0432\u043e\u0435<\/p>\n<details class=\"spoiler\">\n<summary>MyGameModeBase.h<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/ Fill out your copyright notice in the Description page of Project Settings.  #pragma once  #include \"CoreMinimal.h\" #include \"GameFramework\/GameModeBase.h\"   #include \"Interfaces\/IHttpResponse.h\" #include \"HTTPModule.h\"  #include \"MyGameModeBase.generated.h\"  \/**  *   *\/ UCLASS() class SCREENSHOTS_API AMyGameModeBase : public AGameModeBase { GENERATED_BODY()  public: UFUNCTION(BlueprintCallable) void TakeScreenshot();  private: \/\/ This is the filename for screenshot, fixed for simplicity FString ScreenshotFileName = \"D:\/shots\/screenshot.png\";  \/\/ These will be used for request body in the code FString BoundaryLabel = FString(); FString BoundaryBegin = FString(); FString BoundaryEnd = FString();   \/\/ Main function for upload void UploadScreenshot(FString FullFilePath);  \/\/ This is a function to add simple text fields to response FString AddData(FString Name, FString Value);  \/\/ Callback to process response from the server void ProcessResponse(FString ResponseContent);  \/\/ This will be called after screenshot has been taken void ScreenshotCallback();  };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430<s>\u0448<\/s>\u043a\u043e\u0434\u0438\u0442\u044c \u0432 cpp \u0444\u0430\u0439\u043b, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u043e\u0442,<\/p>\n<details class=\"spoiler\">\n<summary>MyGameModeBase.cpp:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\"> #include \"MyGameModeBase.h\"  #include \"ImageUtils.h\" #include \"HighResScreenshot.h\" #include \"LevelEditor.h\" #include \"LevelEditor\/Public\/SLevelViewport.h\"  TArray&lt;uint8> FStringToUint8(const FString&amp; InString) { TArray&lt;uint8> OutBytes;  \/\/ Handle empty strings if (InString.Len() > 0) { FTCHARToUTF8 Converted(*InString); \/\/ Convert to UTF8 OutBytes.Append(reinterpret_cast&lt;const uint8*>(Converted.Get()), Converted.Length()); }  return OutBytes; }  FString AMyGameModeBase::AddData(FString Name, FString Value) { return FString(TEXT(\"\\r\\n\")) + BoundaryBegin + FString(TEXT(\"Content-Disposition: form-data; name=\\\"\")) + Name + FString(TEXT(\"\\\"\\r\\n\\r\\n\")) + Value; }  void AMyGameModeBase::TakeScreenshot() { FHighResScreenshotConfig&amp; HighResScreenshotConfig = GetHighResScreenshotConfig(); HighResScreenshotConfig.SetResolution(1920, 1080); HighResScreenshotConfig.SetFilename(ScreenshotFileName);  HighResScreenshotConfig.SetMaskEnabled(false); HighResScreenshotConfig.SetHDRCapture(false);  FLevelEditorModule&amp; LevelEditor = FModuleManager::GetModuleChecked&lt;FLevelEditorModule>(\"LevelEditor\"); SLevelViewport* LevelViewport = LevelEditor.GetFirstActiveLevelViewport().Get();   FScreenshotRequest::OnScreenshotRequestProcessed().AddUObject(this, &amp;AMyGameModeBase::ScreenshotCallback);  LevelViewport->GetActiveViewport()->TakeHighResScreenShot();  }  void AMyGameModeBase::ScreenshotCallback() { FScreenshotRequest::OnScreenshotRequestProcessed().RemoveAll(this); UploadScreenshot(ScreenshotFileName); };  void AMyGameModeBase::UploadScreenshot(FString FullFilePath) { FString FileName = FPaths::GetCleanFilename(FullFilePath);  FHttpModule&amp; HttpModule = FHttpModule::Get(); TSharedRef&lt;IHttpRequest, ESPMode::ThreadSafe> HttpRequest = HttpModule.CreateRequest();  \/\/ We set the api URL HttpRequest->SetURL(\"http:\/\/127.0.0.1:3000\/upload\");  \/\/ We set verb of the request (GET\/PUT\/POST) HttpRequest->SetVerb(TEXT(\"POST\"));   \/\/ Create a boundary label, for the header BoundaryLabel = FString(TEXT(\"e543322540af456f9a3773049ca02529-\")) + FString::FromInt(FMath::Rand()); \/\/ boundary label for begining of every payload chunk  BoundaryBegin = FString(TEXT(\"--\")) + BoundaryLabel + FString(TEXT(\"\\r\\n\")); \/\/ boundary label for the end of payload BoundaryEnd = FString(TEXT(\"\\r\\n--\")) + BoundaryLabel + FString(TEXT(\"--\\r\\n\"));  \/\/ Set the content-type for server to know what are we going to send HttpRequest->SetHeader(TEXT(\"Content-Type\"), FString(TEXT(\"multipart\/form-data; boundary=\")) + BoundaryLabel);   \/\/ This is binary content of the request TArray&lt;uint8> CombinedContent;  TArray&lt;uint8> FileRawData; FFileHelper::LoadFileToArray(FileRawData, *FullFilePath);   \/\/ First, we add the boundary for the file, which is different from text payload FString FileBoundaryString = FString(TEXT(\"\\r\\n\")) + BoundaryBegin + FString(TEXT(\"Content-Disposition: form-data; name=\\\"uploadFile\\\"; filename=\\\"\")) + FileName + \"\\\"\\r\\n\" + \"Content-Type: image\/png\" + FString(TEXT(\"\\r\\n\\r\\n\"));  \/\/ Notice, we convert all strings into uint8 format using FStringToUint8 CombinedContent.Append(FStringToUint8(FileBoundaryString));  \/\/ Append the file data CombinedContent.Append(FileRawData);  \/\/ Let's add couple of text values to the payload CombinedContent.Append(FStringToUint8(AddData(\"IAmAKey\", \"IamAValue\"))); CombinedContent.Append(FStringToUint8(AddData(\"IAmAnotherKey\", \"IAmAnotherValue\")));  \/\/ Finally, add a boundary at the end of the payload CombinedContent.Append(FStringToUint8(BoundaryEnd));  \/\/ Set the request content HttpRequest->SetContent(CombinedContent);   \/\/ Hook a lambda(anonymous function) to when we receive a response HttpRequest->OnProcessRequestComplete().BindLambda( [this]( FHttpRequestPtr pRequest, FHttpResponsePtr pResponse, bool connectedSuccessfully) mutable { UE_LOG(LogTemp, Error, TEXT(\"Connection.\"));  if (connectedSuccessfully) { ProcessResponse(pResponse->GetContentAsString()); } else { switch (pRequest->GetStatus()) { case EHttpRequestStatus::Failed_ConnectionError: UE_LOG(LogTemp, Error, TEXT(\"Connection failed.\")); default: UE_LOG(LogTemp, Error, TEXT(\"Request failed.\")); } } });  \/\/ Send the request  HttpRequest->ProcessRequest();  }  void AMyGameModeBase::ProcessResponse(FString ResponseContent) { \/\/ Here you can process the response body UE_LOG(LogTemp, Error, TEXT(\"Response: %s\"), *ResponseContent); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0444\u0430\u0439\u043b\u0435 build.cs \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 PublicDependencyModuleNames, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0432\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c:<\/p>\n<p><code>PublicDependencyModuleNames.AddRange(new string[] { \"Core\", \"CoreUObject\", \"Engine\", \"InputCore\", \"HTTP\" });<\/code><\/p>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 (Ctrl+b). \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ctrl+F5, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0442 (\u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u041a\u044d\u043f!).<\/p>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0432\u0430\u0448\u0438\u043c \u0421++ \u043a\u043b\u0430\u0441\u0441\u043e\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/02f\/392\/fc7\/02f392fc7e869876d5f94a5c2a18e929.png\" alt=\"\u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0421++ \u043a\u043b\u0430\u0441\u0441\u0443\" title=\"\u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0421++ \u043a\u043b\u0430\u0441\u0441\u0443\" width=\"720\" height=\"270\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/02f\/392\/fc7\/02f392fc7e869876d5f94a5c2a18e929.png\"\/><figcaption>\u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0421++ \u043a\u043b\u0430\u0441\u0441\u0443<\/figcaption><\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 \u0438\u043a\u043e\u043d\u043a\u0435 \u043a\u043b\u0430\u0441\u0441\u0430, \u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <strong>Create blueprint class from MyGameModeBase, <\/strong>\u044f \u0441\u0432\u043e\u0439 \u043d\u0430\u0437\u0432\u0430\u043b <strong>BP_MyGameModeBase<\/strong>.<\/p>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 blueprint, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0433\u043e\u0440\u044f\u0447\u0443\u044e \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0430 Home. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0432 <strong>BeginPlay<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0434\u0443 <strong>Enable Input<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0433\u043e\u0442\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/675\/3fd\/8a5\/6753fd8a50413031997b90d08f856c16.png\" alt=\"\u0413\u043e\u0442\u043e\u0432\u044b\u0439 BP_MyGameMode\" title=\"\u0413\u043e\u0442\u043e\u0432\u044b\u0439 BP_MyGameMode\" width=\"443\" height=\"402\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/675\/3fd\/8a5\/6753fd8a50413031997b90d08f856c16.png\"\/><figcaption>\u0413\u043e\u0442\u043e\u0432\u044b\u0439 BP_MyGameMode<\/figcaption><\/figure>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0432\u0430\u0448 <strong>GameMode<\/strong>.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u044f \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (<strong>Edit->Project settings -> Maps&amp;Modes -> Default Modes<\/strong>), \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 BP \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 <strong>Default GameMode<\/strong>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e57\/e13\/41a\/e57e1341a9739e78e2ab336bf9705cee.png\" alt=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" title=\"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" width=\"1592\" height=\"387\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e57\/e13\/41a\/e57e1341a9739e78e2ab336bf9705cee.png\"\/><figcaption>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/figure>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <s>\u0437\u0430\u0432\u0435\u0442\u043d\u0443\u044e <\/s>\u0433\u043e\u0440\u044f\u0447\u0443\u044e \u043a\u043b\u0430\u0432\u0438\u0448\u0443, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432 BP. \u0412 \u043b\u043e\u0433\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u0430\u043a\u043e\u0435 (\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f Error \u0432 \u043b\u043e\u0433\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438):<\/p>\n<p><code>LogTemp: Warning: Screenshot name:<br \/> LogRenderer: Reallocating scene render targets to support 1940x1080 Format 10 NumSamples 1 (Frame:366).<br \/> LogClient: High resolution screenshot saved as D:\/shots\/screenshot.png<br \/> LogTemp: Error: Connection.<br \/> LogTemp: Error: Response: {\"message\":\"OK\"}<\/code><\/p>\n<p>\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0442\u043e \u0432\u0430\u0448 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0430\u043f\u043a\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 <strong>\/public<\/strong>, \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430: <strong>screenshot.png<\/strong>. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/575\/54d\/811\/57554d811f3389992a8851fa3787e423.png\" alt=\"\u041b\u043e\u0433 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\" title=\"\u041b\u043e\u0433 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\" width=\"690\" height=\"217\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/575\/54d\/811\/57554d811f3389992a8851fa3787e423.png\"\/><figcaption>\u041b\u043e\u0433 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/figcaption><\/figure>\n<p>\u0412 \u043b\u043e\u0433\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 \u00abIAmAValue\u00bb, \u044d\u0442\u043e \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u043e\u0434\u0430 (\u0432 cpp \u0444\u0430\u0439\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f AddData). \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>console.log(req.body.IAmAKey);<\/code><\/p>\n<p>\u0412\u043e\u0442, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438 \u0432\u0441\u0435.<\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u043d\u0443 \u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043a\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044f \u0442\u0430\u043c \u043d\u0430 \u043b\u0430\u043f\u0448\u0435\u043a\u043e\u0434\u0438\u043b \u0432 cpp \u0444\u0430\u0439\u043b\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0442\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442, \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043d\u043e \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043f\u0435\u0440\u0432\u0430, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e TakeScreenshot. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b HighResScreenshot, \u043e\u043d\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 RequestScreenshot(\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0438\u0437 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u043f\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u043e\u0432). \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 HighResShot \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0434\u0432\u0438\u0436\u043a\u0430, \u0431\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <strong>FHighResScreenshotConfig<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>GetHighResScreenshotConfig()<\/strong>.<\/p>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (SetFilename \u0438 SetResolution \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e).<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438: <\/p>\n<p><code>FScreenshotRequest::OnScreenshotRequestProcessed().AddUObject(this, &amp;AMyGameModeBase::ScreenshotCallback);<\/code><\/p>\n<p>\u0443\u043a\u0430\u0437\u0430\u0432 \u0430\u0434\u0440\u0435\u0441 \u043d\u0443\u0436\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438: <code>(&amp;AMyGameModeBase::ScreenshotCallback).<\/code><\/p>\n<p>\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 <code>UploadScreenshot(ScreenshotFileName)<\/code><\/p>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u0435 \u0432\u0434\u0430\u0432\u0430\u044f\u0441\u044c \u0432 \u0434\u0435\u0431\u0440\u0438, \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 payload, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (\u0434\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430\u0448\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430).<\/p>\n<p>\u041e\u043d \u0440\u0430\u0437\u0431\u0438\u0442 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c (\u043a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u043e\u0434\u0438\u043d \u043d\u0430 \u0432\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c, \u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043e\u043d \u0438 \u043d\u0443\u0436\u0435\u043d). \u041e\u043d \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438 \u0432 payload \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0436\u0434\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0441\u043e\u0431\u0440\u0430\u043b \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0435\u0440 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438:<\/p>\n<pre><code> -----------------------------36046369012372559869891778320  Content-Disposition: form-data; name=\"uploadFile\"; filename=\"tayron_family.jpg\"  Content-Type: image\/jpeg  \u0085b\u00b0m\u00d2\u00c4\u0091.6\u00a3\u00e1'\u008e?V&amp;H(*LXv\u00ac\u00ab}\u00ddx\u00e4@\u00cc\u00a19\u00c6\u00a2\u00af\u00d1\u00bfZ9^Jki  -----------------------------36046369012372559869891778320--<\/code><\/pre>\n<p>\u044d\u0442\u043e\u0442 \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u0448\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 (\u0432\u0435\u0440\u043d\u0435\u0435 \u0447\u0430\u0441\u0442\u044c \u0435\u0435, \u043a\u0430\u043a \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435).<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code>--e543322540af456f9a3773049ca02529-9903 Content-Disposition: form-data; name=\"IAmTheKey\" IAmTheValue  --e543322540af456f9a3773049ca02529-9903--<\/code><\/pre>\n<p>\u041a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432 JSON \u043e\u0431\u044a\u0435\u043a\u0442 <code>{ \"IAmTheKey\": \"IAmTheValue\"}<\/code><\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u043c\u0435\u043d\u044f, \u0433\u0443\u0440\u0443 http, \u044f \u043d\u0435 \u0432\u043b\u0430\u0434\u0435\u044e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043c\u0438, \u0438 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0430\u0433\u043e\u0440\u043e\u0434\u0438\u043b \u0447\u0435\u043f\u0443\u0445\u0438 \u0432 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 UE \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>HttpModule.CreateRequest()<\/code>, \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0423\u043a\u0430\u0436\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<p><code>HttpRequest->SetHeader(TEXT(\"Content-Type\"), FString(TEXT(\"multipart\/form-data; boundary=\")) + BoundaryLabel);<\/code><\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (<strong>Content-Type<\/strong>) \u0432\u0438\u0434\u0430 <strong>multipart\/form-data.<\/strong> \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 payload \u043d\u0438\u0436\u0435.<\/p>\n<p>\u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u0434\u0438\u0441\u043a\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<p><code>FFileHelper::LoadFileToArray(FileRawData, *FullFilePath);<\/code><\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430, \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e CombinedContent, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c payload \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (TArray&lt;uint8>), \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, \u043d\u043e \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 uint8, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>FStringToUint8(FileBoundaryString)<\/code><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u043e\u0439, \u0443 \u043d\u0430\u0441 \u0443\u043a\u0430\u0437\u0430\u043d <strong>Content-Type: image\/jpeg<\/strong>. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043f\u043e\u0439\u043c\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0435\u043c\u0443 <s>\u0432\u043f\u0430\u0440\u0438\u0432\u0430\u0435\u043c <\/s>\u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438, \u0438 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u0431\u0430\u0439\u0442\u043e\u0432 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043e\u0442 \u044d\u0442\u043e\u0433\u043e <code>HttpRequest->OnProcessRequestComplete().BindLambda[this](...)<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043b\u044f\u043c\u0431\u0434\u0443 (\u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0434\u043b\u044f \u0431\u0435\u0437\u044b\u043c\u044f\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438), \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0430 &#8212; \u043b\u044f\u043c\u0431\u0434\u0430, \u043e\u043d\u0430 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u044b\u043b\u0430 \u0432\u044b\u0437\u0432\u0430\u043d\u0430, \u0442.\u0435. \u0432 \u0442\u0435\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c, \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e this, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f&#8230; \u0434\u0430, \u043e\u043d \u0441\u0430\u043c\u044b\u0439 this, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e\u043d \u043e\u043d, \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u0447\u043a\u0430\u0445 \u043f\u043e\u0441\u043b\u0435 BindLambda, \u043d\u0430 \u0437\u0430\u043c\u043e\u0440\u0441\u043a\u043e\u043c \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f capturing. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0438\u0437 \u0442\u0435\u043b\u0430 <s>\u0444\u0443\u043d\u043a<\/s> \u043b\u044f\u043c\u0431\u0434\u044b:<\/p>\n<pre><code class=\"cpp\">if (connectedSuccessfully)  {   ProcessResponse(pResponse->GetContentAsString()); }<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u043e\u0439: <code>HttpRequest->ProcessRequest();<\/code><\/p>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f, \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0432\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0443\u043c\u0431\u0443\u0440\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435.<\/p>\n<\/div>\n<\/details>\n<p>\u00a0<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/714948\/\"> https:\/\/habr.com\/ru\/post\/714948\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u0438!<\/p>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0440\u043e\u0431\u0430 \u043f\u0435\u0440\u0430, \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043c\u043e\u043c, \u043f\u0430\u0440\u0434\u043e\u043d\u044c\u0442\u0435.<\/p>\n<p>\u0414\u0430, \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043c\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u043d\u0430 \u0444\u043e\u0440\u0443\u043c\u0435 EpicGames, \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/dev.epicgames.com\/community\/learning\/tutorials\/R6rv\/unreal-engine-upload-an-image-using-http-post-request-c\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043b\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 UE \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0443 \u0434\u0432\u0438\u0436\u043a\u0430 \u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043d\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043d\u0435\u0442. \u0427\u0442\u043e \u0436, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0431\u043b\u0430\u0433\u043e, \u044d\u0442\u043e \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439, \u0438\u0433\u0440\u0443\u0448\u0435\u0447\u043d\u044b\u0439, \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438, \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0431\u0443\u043c\u0430\u0433\u043e\u043c\u0430\u0440\u0430\u043d\u0438\u0435 \u2013 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430 C++ \u0432 Unreal. \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u0435\u0449\u0438, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0434\u043b\u044f \u0434\u0430\u043b\u0435\u043a\u0438\u0445 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043b\u044e\u0434\u0435\u0439 (\u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u044f).<\/p>\n<h2>\u0421\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p> \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u0432 back-end, \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 <a href=\"https:\/\/github.com\/RadAlex\/express-upload-template\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u0435<\/a>.<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0430\u043c \u043f\u0430\u043f\u043a\u0443, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443: <code>git clone https:\/\/github.com\/RadAlex\/express-upload-template.git<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <a href=\"https:\/\/nodejs.org\/\" rel=\"noopener noreferrer nofollow\">node js<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 (\u0438\u043b\u0438 \u0432 VS code terminal) \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm install<\/code><\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>npm run start <\/code>\u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 <a href=\"http:\/\/127.0.0.1:3000\/upload\" rel=\"noopener noreferrer nofollow\"><strong>http:\/\/127.0.0.1:3000\/upload<\/strong><\/a><\/p>\n<\/li>\n<li>\n<p>\u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u0439\u0441\u044f \u0444\u043e\u0440\u043c\u0435, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u043d\u0430 \u0434\u0438\u0441\u043a\u0435, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 Browse, \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 Upload<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>\/public<\/code><strong><em>, <\/em><\/strong>\u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c:<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (<code>include<\/code> \u0432 \u043f\u0430\u0440\u0430\u0434\u0438\u0433\u043c\u0435 \u0421++).<\/p>\n<p>\u0422\u0430\u043c \u0436\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u043f\u043e\u0440\u0442\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435, endpoints, \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 HTTP \u0431\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e GET \u0438 POST.<\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, GET \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>app.get(\"\/\", function (req, res) { \u00a0res.send(\"Hey!\");});<\/code><\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>http:\/\/127.0.0.1:3000\/<\/code> \u0442\u043e \u043e\u043d \u0432\u0435\u0440\u043d\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u201cHey!\u201d.<\/p>\n<figure class=\"bordered\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0438\u0436\u0435 \u0443\u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435 \u0442\u0435\u043a\u0441\u0442, \u0430 HTML \u0444\u0430\u0439\u043b, upload.html<\/p>\n<p><code>app.get(\"\/upload\", function (req, res) {<\/code><\/p>\n<p><code>\u00a0 res.sendFile(path.join(__dirname, \"\/public\/upload.html\"));<\/code><\/p>\n<p><code>});<\/code><\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u00a0<\/p>\n<p>Endpoint \u0434\u043b\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b app.post().<\/p>\n<p>app.post(&#171;\/upload&#187;, async function (req, res) {\u2026 }).<\/p>\n<p>\u041f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435, \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 req.files (\u0432\u0435\u0434\u044c \u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e).<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0434\u044f \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0443\u044e \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0444\u0430\u0439\u043b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/p>\n<p><code>const uploadedFile = req.files.uploadFile.<\/code><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u043f\u0443\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f (\u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e uploadedFile.name):<\/p>\n<p><code>const uploadPath = __dirname + \"\/public\/\" + filename;<\/code><\/p>\n<p>\u0418 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 mv :<\/p>\n<p>\u00a0\u00a0\u00a0 <code>uploadedFile.mv(uploadPath, function (err) {\u2026})<\/code><\/p>\n<p>\u00a0<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p><code>app.listen(PORT, () => {<\/code><\/p>\n<p><code>\u00a0 console.log(app is running on PORT ${PORT});<\/code><\/p>\n<p><code>});<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043c\u044b \u0442\u0443\u0442 \u0441\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c.<\/p>\n<h2>Unreal<\/h2>\n<p>\u041a\u043e\u0434 \u043f\u0438\u0441\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 4.27.2, \u043d\u043e \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u043f\u0440\u0438\u0447\u0438\u043d, \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f \u0432 5\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.<\/p>\n<p><a href=\"https:\/\/dev.epicgames.com\/community\/learning\/tutorials\/ZdXD\/call-rest-api-using-http-json-from-ue5-c\" rel=\"noopener noreferrer nofollow\">\u0422\u0443\u0442 <\/a>\u0438 <a href=\"https:\/\/benui.ca\/unreal\/http-post\/\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442 <\/a>\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u044b \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u043d\u043e \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044f MimeUpload, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438.<\/p>\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 GameModeBase, \u0447\u0442\u043e \u043d\u0435 \u0435\u0441\u0442\u044c \u0433\u0443\u0442, \u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b. \u0412\u0435\u0434\u044c \u044d\u0442\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u0442\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0445 \u0432\u0435\u0449\u0435\u0439, \u0438 \u0447\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u043c\u0443, \u0442\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0443\u0441\u0432\u043e\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0432\u0430\u043c \u0432\u0432\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0432 \u0437\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u043d\u0443 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e <s>\u0431\u0440\u0435\u0434\u043e\u043c<\/s> <s>\u043d\u0430\u0433\u043b\u043e\u0439 \u043b\u043e\u0436\u044c\u044e<\/s> \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u043c\u0438, \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d \u0437\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044e.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c:<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 (\u0421++ \u0438\u043b\u0438 blueprint, \u043d\u0435 \u0432\u0430\u0436\u043d\u043e)<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0421++ \u043a\u043b\u0430\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b (<strong>File-> Add new C++ class<\/strong>)<\/p>\n<p>\u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043a\u0430\u043a \u0445\u043e\u0442\u0438\u0442\u0435, \u043c\u043e\u0439 \u043d\u043e\u0441\u0438\u0442 \u0443\u0436\u0430\u0441\u043d\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f: <strong>MyGameModeBase<\/strong><\/p>\n<p>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 (\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u044f\u043c\u043e \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 GameMode), \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c SCREENSHOTS_API \u043d\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0432\u0441\u0435 \u0431\u0443\u043a\u0432\u044b \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0435), \u00a0\u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443, \u0435\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 <strong>AMyGameModeBase<\/strong> \u043d\u0430 \u0441\u0432\u043e\u0435<\/p>\n<details class=\"spoiler\">\n<summary>MyGameModeBase.h<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">\/\/ Fill out your copyright notice in the Description page of Project Settings.  #pragma once  #include \"CoreMinimal.h\" #include \"GameFramework\/GameModeBase.h\"   #include \"Interfaces\/IHttpResponse.h\" #include \"HTTPModule.h\"  #include \"MyGameModeBase.generated.h\"  \/**  *   *\/ UCLASS() class SCREENSHOTS_API AMyGameModeBase : public AGameModeBase { GENERATED_BODY()  public: UFUNCTION(BlueprintCallable) void TakeScreenshot();  private: \/\/ This is the filename for screenshot, fixed for simplicity FString ScreenshotFileName = \"D:\/shots\/screenshot.png\";  \/\/ These will be used for request body in the code FString BoundaryLabel = FString(); FString BoundaryBegin = FString(); FString BoundaryEnd = FString();   \/\/ Main function for upload void UploadScreenshot(FString FullFilePath);  \/\/ This is a function to add simple text fields to response FString AddData(FString Name, FString Value);  \/\/ Callback to process response from the server void ProcessResponse(FString ResponseContent);  \/\/ This will be called after screenshot has been taken void ScreenshotCallback();  };<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430<s>\u0448<\/s>\u043a\u043e\u0434\u0438\u0442\u044c \u0432 cpp \u0444\u0430\u0439\u043b, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u043e\u0442,<\/p>\n<details class=\"spoiler\">\n<summary>MyGameModeBase.cpp:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\"> #include \"MyGameModeBase.h\"  #include \"ImageUtils.h\" #include \"HighResScreenshot.h\" #include \"LevelEditor.h\" #include \"LevelEditor\/Public\/SLevelViewport.h\"  TArray&lt;uint8> FStringToUint8(const FString&amp; InString) { TArray&lt;uint8> OutBytes;  \/\/ Handle empty strings if (InString.Len() > 0) { FTCHARToUTF8 Converted(*InString); \/\/ Convert to UTF8 OutBytes.Append(reinterpret_cast&lt;const uint8*>(Converted.Get()), Converted.Length()); }  return OutBytes; }  FString AMyGameModeBase::AddData(FString Name, FString Value) { return FString(TEXT(\"\\r\\n\")) + BoundaryBegin + FString(TEXT(\"Content-Disposition: form-data; name=\\\"\")) + Name + FString(TEXT(\"\\\"\\r\\n\\r\\n\")) + Value; }  void AMyGameModeBase::TakeScreenshot() { FHighResScreenshotConfig&amp; HighResScreenshotConfig = GetHighResScreenshotConfig(); HighResScreenshotConfig.SetResolution(1920, 1080); HighResScreenshotConfig.SetFilename(ScreenshotFileName);  HighResScreenshotConfig.SetMaskEnabled(false); HighResScreenshotConfig.SetHDRCapture(false);  FLevelEditorModule&amp; LevelEditor = FModuleManager::GetModuleChecked&lt;FLevelEditorModule>(\"LevelEditor\"); SLevelViewport* LevelViewport = LevelEditor.GetFirstActiveLevelViewport().Get();   FScreenshotRequest::OnScreenshotRequestProcessed().AddUObject(this, &amp;AMyGameModeBase::ScreenshotCallback);  LevelViewport->GetActiveViewport()->TakeHighResScreenShot();  }  void AMyGameModeBase::ScreenshotCallback() { FScreenshotRequest::OnScreenshotRequestProcessed().RemoveAll(this); UploadScreenshot(ScreenshotFileName); };  void AMyGameModeBase::UploadScreenshot(FString FullFilePath) { FString FileName = FPaths::GetCleanFilename(FullFilePath);  FHttpModule&amp; HttpModule = FHttpModule::Get(); TSharedRef&lt;IHttpRequest, ESPMode::ThreadSafe> HttpRequest = HttpModule.CreateRequest();  \/\/ We set the api URL HttpRequest->SetURL(\"http:\/\/127.0.0.1:3000\/upload\");  \/\/ We set verb of the request (GET\/PUT\/POST) HttpRequest->SetVerb(TEXT(\"POST\"));   \/\/ Create a boundary label, for the header BoundaryLabel = FString(TEXT(\"e543322540af456f9a3773049ca02529-\")) + FString::FromInt(FMath::Rand()); \/\/ boundary label for begining of every payload chunk  BoundaryBegin = FString(TEXT(\"--\")) + BoundaryLabel + FString(TEXT(\"\\r\\n\")); \/\/ boundary label for the end of payload BoundaryEnd = FString(TEXT(\"\\r\\n--\")) + BoundaryLabel + FString(TEXT(\"--\\r\\n\"));  \/\/ Set the content-type for server to know what are we going to send HttpRequest->SetHeader(TEXT(\"Content-Type\"), FString(TEXT(\"multipart\/form-data; boundary=\")) + BoundaryLabel);   \/\/ This is binary content of the request TArray&lt;uint8> CombinedContent;  TArray&lt;uint8> FileRawData; FFileHelper::LoadFileToArray(FileRawData, *FullFilePath);   \/\/ First, we add the boundary for the file, which is different from text payload FString FileBoundaryString = FString(TEXT(\"\\r\\n\")) + BoundaryBegin + FString(TEXT(\"Content-Disposition: form-data; name=\\\"uploadFile\\\"; filename=\\\"\")) + FileName + \"\\\"\\r\\n\" + \"Content-Type: image\/png\" + FString(TEXT(\"\\r\\n\\r\\n\"));  \/\/ Notice, we convert all strings into uint8 format using FStringToUint8 CombinedContent.Append(FStringToUint8(FileBoundaryString));  \/\/ Append the file data CombinedContent.Append(FileRawData);  \/\/ Let's add couple of text values to the payload CombinedContent.Append(FStringToUint8(AddData(\"IAmAKey\", \"IamAValue\"))); CombinedContent.Append(FStringToUint8(AddData(\"IAmAnotherKey\", \"IAmAnotherValue\")));  \/\/ Finally, add a boundary at the end of the payload CombinedContent.Append(FStringToUint8(BoundaryEnd));  \/\/ Set the request content HttpRequest->SetContent(CombinedContent);   \/\/ Hook a lambda(anonymous function) to when we receive a response HttpRequest->OnProcessRequestComplete().BindLambda( [this]( FHttpRequestPtr pRequest, FHttpResponsePtr pResponse, bool connectedSuccessfully) mutable { UE_LOG(LogTemp, Error, TEXT(\"Connection.\"));  if (connectedSuccessfully) { ProcessResponse(pResponse->GetContentAsString()); } else { switch (pRequest->GetStatus()) { case EHttpRequestStatus::Failed_ConnectionError: UE_LOG(LogTemp, Error, TEXT(\"Connection failed.\")); default: UE_LOG(LogTemp, Error, TEXT(\"Request failed.\")); } } });  \/\/ Send the request  HttpRequest->ProcessRequest();  }  void AMyGameModeBase::ProcessResponse(FString ResponseContent) { \/\/ Here you can process the response body UE_LOG(LogTemp, Error, TEXT(\"Response: %s\"), *ResponseContent); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0444\u0430\u0439\u043b\u0435 build.cs \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 PublicDependencyModuleNames, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0432\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c:<\/p>\n<p><code>PublicDependencyModuleNames.AddRange(new string[] { \"Core\", \"CoreUObject\", \"Engine\", \"InputCore\", \"HTTP\" });<\/code><\/p>\n<p>\u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 (Ctrl+b). \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ctrl+F5, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0442 (\u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u041a\u044d\u043f!).<\/p>\n<p>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0432\u0430\u0448\u0438\u043c \u0421++ \u043a\u043b\u0430\u0441\u0441\u043e\u043c:<\/p>\n<figure class=\"full-width\"><figcaption>\u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0421++ \u043a\u043b\u0430\u0441\u0441\u0443<\/figcaption><\/figure>\n<p>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u043e\u0439<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-344984","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=344984"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/344984\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}