Home > other >  To upload pictures
To upload pictures

Time:11-24

In aircraft booking system, the initial contact the upload pictures and pictures of a series of methods of type


Determine whether to read the file is required file type, image files regular expression to filter the image/jpeg, image/PNG, image/JPG, image/GIF image/BMP

Using the file reader read the file and the file into a URL (Base64 encoding)

Such as: imageReader readAsDataURL (file);
To the controller after check whether there is a store user avatar directory - & gt; Determine whether to upload the image - & gt; After uploading file extension name - & gt; Joining together to save the file name - & gt; Joining together the path of the file - & gt; Upload file to disk - & gt; Last save file name to the user object using
Remember that can only be used when file upload post submission, cannot use get to submit, because if use the get submitted, sometimes can't submit or submit,

DateTime: said a moment of time, usually expressed as a date and time of day
DateTime. Now. ToString (" MM - dd yyyy - HH: MM: ss ")//convert time to standard time, such as: the 2020-07-22 19:

After the success of the user data, obtain the saved user ID - Lin after new data after new data will be used by the primary key of the ID set up to keep objects
  • Related