added image feedback on upload
4
index.js
|
|
@ -120,7 +120,7 @@ app.post("/upload", upload, function(req, res) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fs.rmdir(
|
fs.rm(
|
||||||
"./public/uploads/" + req.files.file.uuid,
|
"./public/uploads/" + req.files.file.uuid,
|
||||||
{ recursive: true },
|
{ recursive: true },
|
||||||
function(err) {
|
function(err) {
|
||||||
|
|
@ -142,7 +142,7 @@ app.post("/upload", upload, function(req, res) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
fs.rmdir(
|
fs.rm(
|
||||||
"./public/uploads/" + req.files.file.uuid,
|
"./public/uploads/" + req.files.file.uuid,
|
||||||
{ recursive: true },
|
{ recursive: true },
|
||||||
function(err) {
|
function(err) {
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
|
@ -10,11 +10,17 @@
|
||||||
<body>
|
<body>
|
||||||
<form action="/upload" method="POST" enctype="multipart/form-data">
|
<form action="/upload" method="POST" enctype="multipart/form-data">
|
||||||
<legend>Whos Cat is That??!?</legend>
|
<legend>Whos Cat is That??!?</legend>
|
||||||
<input type="file" name="file">
|
<input type="file" name="file" onchange="loadFile(event)">
|
||||||
|
<img id="output" width="200" />
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary">Upload</button>
|
<button type="submit" class="btn btn-primary">Upload</button>
|
||||||
</form>
|
</form>
|
||||||
center
|
center
|
||||||
p not 100% success rate pls dont be too mad if it gets things wrong
|
p not 100% success rate pls dont be too mad if it gets things wrong
|
||||||
|
script.
|
||||||
|
var loadFile = function(event){
|
||||||
|
var image = document.getElementById('output');
|
||||||
|
image.src = URL.createObjectURL(event.target.files[0]);
|
||||||
|
};
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
||||||