我有一个文件输入框。
我正在使用它来上传项目中的图片。如何使用JS将已上传的图片保存到特定的本地文件夹中?
<input type="file" class="file-input">
我正在使用它来上传项目中的图片。如何使用JS将已上传的图片保存到特定的本地文件夹中?
<input type="file" class="file-input">
$('input[type="file"]').on('change', function () {
var reader = new FileReader();
reader.onload = function () {
var thisImage = reader.result;
localStorage.setItem("imgData", thisImage);
};
reader.readAsDataURL(this.files[0]);
});