Home > Back-end >  Visual Studio
Visual Studio

Time:12-04

(3) to upload pictures
Set the ID and click on the name of the event, setting image shows long and high

Set the format of the picture, make it can be submitted through the file upload file type
The accept attribute only with & lt; Input type="file" & gt; Cooperate to use

Set the picture double-click events, use jqury triggers the click event of file option box & lt; Input type="file" & gt;

The custom user avatar click event, view your avatar picture information, according to whether there is a head picture information view/not upload

Click the view button to display images, according to the events will leave the image path, click on the button to play window layer shows images information content, don't open the title, is not set up the close button, can be directly click on the mask layer close the pop-up window,

With image file of the regular expression filter cannot read the file picture format, display can select image files, will choose picture to ing elements, and use the FileReader reads the images into a URL, use file read the onl oad event, will read the pictures showed to ing element

Popup window modified modal form set shows the location of the user avatar and image path
Keep head is modify the user information, first of all get the user avatar parameter, use the JQuery Ajax send FormData data, build the FormData data, data submitted to the controller, to tell JQuery don't sent to deal with data and don't set the content-type request header


Query before avatar picture information, see whether to upload the image, set the file type (Path: contains information about a file or directory Path System. String instance execution) (GetExtension: the specified Path String extensions) return Path to receive files
Save the file path and server deployment path, set the file name to the user, before the judgment whether there was a picture before, you need to remove the old image information, to upload pictures don't do any deal with the images in the database directly set hair oh the user object,