-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove file from folder when delete data from db
- Loading branch information
1 parent
dde0a1c
commit 03b6a79
Showing
4 changed files
with
53 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,69 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>Upload Form</title> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | ||
<style type="text/css"> | ||
img{ | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
img { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="row"> | ||
<h2>Add Data</h2> | ||
|
||
<form method="post" enctype="multipart/form-data" action="/"> | ||
<div class="form-group row" > | ||
<div class="form-group row"> | ||
<div class="col-md-1" style="float: left;"> | ||
<label for="title" class="col-sm-2 col-form-label" >Title</label> | ||
<label for="title" class="col-sm-2 col-form-label">Title</label> | ||
</div> | ||
<div class="col-sm-3" style="float: left;"> | ||
<input type="text" name="title" placeholder="title" class="form-control" required> | ||
</div> | ||
</div> | ||
<div class="form-group row" > | ||
<div class="form-group row"> | ||
<div class="col-lg-2" style="float: left;"> | ||
<input type="file" name="upl" class="form-control-file" accept="image/*" required> | ||
</div> | ||
</div> | ||
<div class="form-group row" > | ||
<div class="form-group row"> | ||
<div class="col-lg-2" style="float: left;"> | ||
<input type="file" name="upl1" class="form-control-file" accept="image/*" required> | ||
</div> | ||
</div> | ||
<div class="form-group row" > | ||
<div class="form-group row"> | ||
<div class="col-lg-2" style="float: left;"> | ||
<input type="submit" class="btn btn-primary"> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="row"> | ||
<% for (var i = 0; i < data.length; i++) { %> | ||
<div class="col-md-4"> | ||
<div class="thumbnail"> | ||
<div class="caption"> | ||
<h3><%= data[i].Name %></h3> | ||
<!-- <h3><%= data[i]._id %></h3> --> | ||
<img src="<%= data[i].image1 %>" class = "img-thumbnail"> | ||
<img src="<%= data[i].image2 %>" class = "img-thumbnail"> | ||
<form method="post" action="/delete"> | ||
<input id="prodId" name="prodId" type="hidden" value="<%= data[i]._id %>"> | ||
<input type="submit" class = "btn btn-danger" name="Delete" value="Delete"> | ||
</form> | ||
<% for (var i=0; i < data.length; i++) { %> | ||
<div class="col-md-4"> | ||
<div class="thumbnail"> | ||
<div class="caption"> | ||
<h3> | ||
<%= data[i].Name %> | ||
</h3> | ||
<img src="<%= data[i].image1 %>" class="img-thumbnail"> | ||
<img src="<%= data[i].image2 %>" class="img-thumbnail"> | ||
</br> | ||
<form method="post" action="/delete"> | ||
<input id="prodId" name="prodId" type="hidden" value="<%= data[i]._id %>"> | ||
<input type="submit" class="btn btn-danger" name="Delete" value="Delete"> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<% } %> | ||
<% } %> | ||
</div> | ||
</div> | ||
</body> | ||
|
||
</html> |