Add 2 string parameters, one is the file name and the other is the file base64 character Visually, your item parameters need to be passed through the form, so the two newly added parameters are also passed through the form. You only need to add the parameters, and then let Android use the form. Just pass the parameters, springmvc will automatically inject the three parameters of the form into your method parameters, then decode the string into a byte array through the base64 decoding class, convert the byte array into a stream, and save the stream to your custom directory Next, use UUID naming to prevent conflicts, and then write the file name and saved path to the database
The contents of all files, regardless of type, are binary data represented by bytes. Base64 encoding is to encode binary data into 64 visible characters, so if you need to restore it, you only need to perform Base64 decoding. If you need any other parameters, just add the original file name (including extension). Directly decode the base64 encoding and save it with the original extension (the file name doesn’t matter), and then you can use it as the original file type.
Add 2 string parameters, one is the file name and the other is the file base64 character
Visually, your item parameters need to be passed through the form, so the two newly added parameters are also passed through the form. You only need to add the parameters, and then let Android use the form. Just pass the parameters, springmvc will automatically inject the three parameters of the form into your method parameters, then decode the string into a byte array through the base64 decoding class, convert the byte array into a stream, and save the stream to your custom directory Next, use UUID naming to prevent conflicts, and then write the file name and saved path to the database
The contents of all files, regardless of type, are binary data represented by bytes.
Base64 encoding is to encode binary data into 64 visible characters, so if you need to restore it, you only need to perform Base64 decoding.
If you need any other parameters, just add the original file name (including extension).
Directly decode the base64 encoding and save it with the original extension (the file name doesn’t matter), and then you can use it as the original file type.