{"id":818,"date":"2024-05-10T10:44:08","date_gmt":"2024-05-10T01:44:08","guid":{"rendered":"https:\/\/mvc.auctionpro.co.kr\/?page_id=818"},"modified":"2024-05-10T10:44:09","modified_gmt":"2024-05-10T01:44:09","slug":"%ed%8c%8c%ec%9d%bc-%ec%97%85%eb%a1%9c%eb%93%9c","status":"publish","type":"page","link":"https:\/\/mvc.auctionpro.co.kr\/?page_id=818","title":{"rendered":"\ud30c\uc77c \uc5c5\ub85c\ub4dc"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Index.cshtml<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >@{\n    ViewData[\"Title\"] = \"Home Page\";\n    Layout = null;\n}\n\n&lt;div class=\"text-center\"&gt;\n    &lt;!-- \uba54\uc2dc\uc9c0\ub97c \ud45c\uc2dc\ud558\ub294 \uc601\uc5ed --&gt;    \n    &lt;div&gt;\n    @ViewBag.Message\n    &lt;\/div&gt;\n     &lt;br\/&gt;\n\n    &lt;form method=\"POST\" enctype=\"multipart\/form-data\" action=\"\/Home\/UploadFile\"&gt;\n        &lt;!-- \ud30c\uc77c \uc5c5\ub85c\ub4dc form enctype\ub294 multipart\/form-data\ub294 \uba54\uc18c\ub4dc \ud0c0\uc785\uc740 POST, URL\uc740 \/Home\/FileUpload\uc774\ub2e4. --&gt;\n        &lt;input type=\"file\" name=\"file\" multiple \/&gt; &lt;!-- file input \ud0dc\uadf8, \uc774\ub984\uc740 file, \ubcf5\uc218 \ud30c\uc77c \ucca8\ubd80\ub97c \uc704\ud574 multiple \uc18d\uc131\uc744 \ucd94\uac00\ud55c\ub2e4. --&gt; \n        &lt;input type=\"submit\"&gt;  \n     &lt;\/form&gt;\n\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">HomeeController.cs<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >using Microsoft.AspNetCore.Mvc;\nusing System.Diagnostics;\nusing WebApplication3.Models;\nusing System.IO;\nusing Microsoft.AspNetCore.Http;\n\nnamespace WebApplication3.Controllers\n{\n    public class HomeController : Controller\n    {\n        private readonly ILogger&lt;HomeController&gt; _logger;\n\n        public HomeController(ILogger&lt;HomeController&gt; logger)\n        {\n            _logger = logger;\n        }\n\n        public IActionResult Index()\n        {\n            return View();\n        }\n\n        public async Task&lt;IActionResult&gt; UploadFile(IFormFile file)\n        {\n            if (file == null || file.Length == 0)\n            {\n                return Content(\"No file selected for upload.\");\n            }\n\n            var path = Path.Combine(Directory.GetCurrentDirectory(), \"wwwroot\/uploads\", file.FileName);\n\n            using (var stream = new FileStream(path, FileMode.Create))\n            {\n                await file.CopyToAsync(stream);\n            }\n\n            ViewBag.Message = \"File Uploaded Successfully.\";\n            \/\/return RedirectToAction(\"Index\"); \/\/ Or any view you want to redirect to\n            return View(\"Index\");\n        }\n\n\n\n        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]\n        public IActionResult Error()\n        {\n            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });\n        }\n    }\n}<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Web<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"190\" src=\"https:\/\/mvc.auctionpro.co.kr\/wp-content\/uploads\/2024\/05\/image.png\" alt=\"\" class=\"wp-image-819\" srcset=\"https:\/\/mvc.auctionpro.co.kr\/wp-content\/uploads\/2024\/05\/image.png 585w, https:\/\/mvc.auctionpro.co.kr\/wp-content\/uploads\/2024\/05\/image-300x97.png 300w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Index.cshtml HomeeController.cs Web<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-818","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=818"}],"version-history":[{"count":1,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/818\/revisions"}],"predecessor-version":[{"id":820,"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/818\/revisions\/820"}],"wp:attachment":[{"href":"https:\/\/mvc.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}