|
@@ -41,6 +41,18 @@ function getImgElements(blockDiv) {
|
|
|
const imgDiv = document.createElement("div");
|
|
|
const img = document.createElement("img");
|
|
|
const imgInput = document.createElement("INPUT");
|
|
|
+ imgInput.setAttribute("type", "file");
|
|
|
+ imgInput.addEventListener('change', function(event) {
|
|
|
+ if (event.target.files[0]) {
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append('image', event.target.files[0])
|
|
|
+ axios.post('http://127.0.0.1:5000/api/upload/img?url=/家具規劃作品/公仔與爵士鼓', formData, {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
const widthInput = document.createElement("INPUT");
|
|
|
const heightInput = document.createElement("INPUT");
|
|
|
const imgInputButton = document.createElement('button');
|