problem description: the pc side takes photos to get the base64 file, wants to upload this file to the local node service, and reads the photo file when querying
problem description: the pc side takes photos to get the base64 file, wants to upload this file to the local node service, and reads the photo file when querying
var formData = new FormData();
var btn = document.getElementById("uploadImg");//
var file = btn.files[0];
formData.append('file',file);//formData
var reader = new FileReader();//
reader.onloadend = function () {
var dataURL = reader.result;
var img = new Image();
img.src = dataURL;
// DOM
// ...
};
reader.readAsDataURL(file);
1. If the photo is obtained by base64, then send it to the server directly with post, and the server will save it
2. Directly assign a value to the src of img when taking it
<img src="data:image/jpeg;base64,xxxxxxxx"
Previous: How to set the transform attribute of an element dynamically?
Next: A config file is customized in egg. How does config.sms.js, use the contents of sms in service?
do the gods have plug-ins for uploading attachments in the mobile version that can also be uploaded more than one? ...
...
adopt a reward of 10 yuan, 1045 Access denied for user root @ localhost (using password:NO) recently, when I was at the front end of my self-study, I came into contact with a little bit of database. This happened when I made a new connection on ...
the backend returns the image address, and after stitching the string, it is displayed on the page The actual address displayed by the src of img is http: localhost:port + picture address which god knows how to solve this problem img src img src...
when our website is opened on the computer side, Baidu news often appears at the bottom of the page. I don t know what this is caused by, is it the code? Did we drive it on our own initiative? Or are there some problems with the settings of the operato...
Warning: Encountered two children with the same key, `.$4`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and or omitted the behavior is unsupported and could change i...
let status = true; while (status) { } console.log ( "not executed here "); ...
Please tell me why chrome debugging js file breakpoint, then why walk to other js files inside? how to avoid this? ...
as shown in the figure, the development environment is configured with forwarding but after packaging, there is no whether the code in the production environment can be forwarded . now the URL in the production environment defaults to the access ...
how do I introduce .vue files into traditional pages? ...
webpack.conf.js const path = require( path ); const webpack = require( webpack ); const HtmlWebpackPlugin = require( html-webpack-plugin ); const uglify = require( uglifyjs-webpack-plugin ); module.exports={ entry:{ ...
I would like to ask the bosses, is the current Mini Program can jump to the mobile app store? Because I saw the web-view tag, didn t it say that you can open the H5 page in Mini Program, so isn t that the same as the H5 jump? how do you do it if you c...
vuescript JS, mounted js script js ,, so, to fix this BUG, you must make sure that the external js is loaded, but I don t know how to make sure that the JS is loaded. May I ask the gods how to do this? ...
merge it locally first. The branch is base master like this, and then the working add commit push prompts up-to-date to think that the file that has not changed the name of the checkout master branch disappears. Excuse me, how can I find these files? ...
excuse me, when can I use loadChildren to route? On the Internet, it is said that the loading sub-module, in the project, what is the sub-module ah. How is this "sub-module " design specification defined? do you have any examples for reference.? ...
Rich text editor is recommended on mobile end of vue project function Picture Video can be uploaded local video the kind of with small expressions similar to Jinri Toutiao do you have any friends who know about it? ...
chrome browser I set up buyNow in cookie and saved three pairs of keys. The browser shows that this has been escaped as follows: 7B%22skuCode%22%3A%22250S1524100609059%22%2C%22num%22%3A1%2C%22unConfirm%22%3Atrue%7D how do I explicitly display thes...
...
how to understand the loading order of script tags? In the browser. ...
Mobile vue ui framework besides VUX,mini-ui, what other UI is better? I found that there are not many components of mini-ui on mobile, and I am not very good at writing CSS myself, especially in grid systems. Then similar questions have been raised befo...