Home > other >  Head portrait
Head portrait

Time:11-20

MVC project image upload steps:
The first step: defined in the front page to upload files
buttons and picture area
The second step: image preview effect
2-1: add to the picture click events (actually trigger file boxes)

2-2: new file reader (when the user to select the image path to backfill to picture)

2-3: to text box binding change events

Step 3: upload picture (front)
3-1: gain data (image)

3-2: build FormData data

3-2: build request (remember that cannot use $. Post method, need to use ajax or native JS XML)

Step 4: head storage (back-end processing)
4-1: define types receive image data

4-2: determine whether to upload the image files

4-3: save the picture to the project folder

4-4: keep the image path to the database

Upload picture:
1. The page to upload pictures data
2. After receiving and image data
3. Save the image to the project folder
4. Keep the image path to the database
  • Related