Commit 92582db9 authored by Frauke's avatar Frauke
Browse files

Removed unnecessary code

parent a2d49a0b
......@@ -22,11 +22,6 @@
<button type="submit" @click="upload">Upload</button>
<button type="reset" @click="remove">Remove image</button>
<p :class="statusMessageClass" v-if="statusMessage">{{ statusMessage }}</p>
<form method='post' id="form" @submit.prevent="submitform" action='http://localhost:3030/image' enctype="multipart/form-data">
<input type='file' name='fileUploaded'>
<input type='submit'>
</form>
</div>
</template>
......@@ -49,9 +44,6 @@ export default {
}
},
methods: {
submitform(e) {
axios.post('http://localhost:3030/image', new FormData(e.target));
},
remove() {
this.cropWidget.remove();
},
......@@ -65,23 +57,10 @@ export default {
return
}
const src = this.cropWidget.img.src
const format = src.split(';')[0].split(':')[1]
this.cropWidget.promisedBlob(format, 0.8).then((blob) => {
// axios({
// url: 'http://localhost:3030/image',
// method: 'post',
// headers: { 'content-type': 'multipart/form-data' },
// data: blob
// }).then((data) => {
// console.log(data)
// }).catch((err) => console.log(err))
const data = new FormData();
data.append('file', blob);
axios.post('http://localhost:3030/image', data);
}).catch((err) => console.log(err))
}
}
......
const express = require('express')
const app = express()
const fileUpload = require('express-fileupload')
const busboy = require('connect-busboy')
const fs = require('fs')
const mime = require('mime-types')
app.use(busboy());
app.use(function(req, res, next) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment