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,
|
||||
{ recursive: true },
|
||||
function(err) {
|
||||
|
|
@ -142,7 +142,7 @@ app.post("/upload", upload, function(req, res) {
|
|||
}
|
||||
}
|
||||
);
|
||||
fs.rmdir(
|
||||
fs.rm(
|
||||
"./public/uploads/" + req.files.file.uuid,
|
||||
{ recursive: true },
|
||||
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>
|
||||
<form action="/upload" method="POST" enctype="multipart/form-data">
|
||||
<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>
|
||||
</form>
|
||||
center
|
||||
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>
|
||||
</html>
|
||||
|
||||
|
|
|
|||