# Image Uploading

ADD NAMESPACE IN USING

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667659930016/gWPdGLfGK.png align="left")


- CREATE VIEW FOR SELECTED ACTIONMETHOD

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660014781/tfjL8k6b6.png align="left")


-MODEL CLASS WITH BE TABLES NAME .CS
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660068562/DNPEHh97w.png align="left")

-VIEW .CSHTML SORRY TABLE NAME WAS Artdetail NOT INIBUYER SO DONT GET DISTRACTED BY INIBUYER

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660127078/1ciM2b7Ox.png align="left")

-IT WILL TAKE IMAGE TO FOLDER INSIDE THE PROJECT AND TO ADD HttpPostedFileBase YOU HAVE TO INCLUDE     using System.Web;

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660497886/jbc2Q8zRu.png align="left")

- <input type="file"  name="File"/> WHERE YOU WANT TO DISPLAY A BUTTON CHOOSE FILE


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660749174/2pd786QkT.png align="left")

-GO UP IN IMAGEEDIT.CSHTML FILE AND YOU WILL SEE FORM BEGIN LIKE

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660822875/WfWONUND1.png align="left")

-WRITE "ACTIONRESULT NAME", "CONTROLLERNAME", FormMethod.Post, new { enctype = "multipart/form-data" })

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1667660979913/xL6t-Gj8-.png align="left")

-Now it will store every picture in image folder and path in sql table so when ever we will try to retrieve image it will  get path from sql table and get into folder made in project earlier that's it.


