I have a projrct but i want to add another fields for uploade image and save in a folder and database as well.
Loading
I have a projrct but i want to add another fields for uploade image and save in a folder and database as well.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jithu ThomasPosted Jun 3, 2024, 8:56 AM
Mr. Soheb Ahmad
This can be achieved in simple 7 steps: -
1. Set Up the Model
First, create a model to represent the image data. This includes the path to the image.
2. Create a Database Context
Set up the database context to interact with the database.
3. Set Up the Controller
Create a controller to handle the image upload logic.
4. Create the Views
Set up the views to upload the image and display success message.
5. Configure the Database
Ensure you have the necessary database configurations in Web.config.
6. Create the Images Folder
Ensure you have an Images folder in the root of your project where the images will be saved.
7. Enable Migrations and Update Database
Enable migrations and update the database to create the necessary table.
Soheb AhmadPosted Jun 3, 2024, 6:04 AM
i build this Peoject using Asp.net MVC in visual studio
Jithu ThomasPosted Jun 3, 2024, 5:36 AM
Mr. Soheb
you have to specify which programming language and platform which your project is being build. say example asp.net with c# or asp.net with VB.net or windows application or MVC
Regards,
Jobin SPosted Jun 3, 2024, 5:33 AM
Hi saheb,
Try this
https://www.c-sharpcorner.com/article/simplifying-file-uploads-with-net-core-7-minimal-apis/