Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MotherProject
/
Learning Images
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
최예리
2019-11-17 23:08:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2e4a39a6dc21a2963ea784b3a588beea0979cf21
2e4a39a6
1 parent
88910042
directoryDeleteCheck 파일에 문제가 있음.
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
server.js
views/directory.pug
views/directoryDeleteCheck.html
views/home.pug
server.js
View file @
2e4a39a
...
...
@@ -74,9 +74,22 @@ app.get('/home/:directoryName/upload', (req, res) => {
// Delete Directory
app
.
delete
(
'/home/:directoryName'
,
(
req
,
res
)
=>
{
app
.
get
(
'/home/:directoryName/delete'
,
(
req
,
res
)
=>
{
// exist query.real
if
(
req
.
query
.
real
!=
undefined
)
{
// Remove Directory and Files
path
=
dataFolder
+
'/'
+
directoryName
;
fs
.
readdirSync
(
path
).
forEach
(
function
(
file
,
index
){
var
curPath
=
path
+
"/"
+
file
;
fs
.
unlinkSync
(
curPath
);
});
fs
.
rmdirSync
(
path
);
res
.
redirect
(
'/home/'
);
}
else
{
res
.
sendfile
(
'./views/directoryDeleteCheck.html'
);
}
});
...
...
views/directory.pug
View file @
2e4a39a
...
...
@@ -5,5 +5,5 @@ html
title 파일 업로드
body
form(action="upload" method="POST" enctype="multipart/form-data")
input(type="file", name="userfile")
input(type="file", name="userfile
[]", multiple="multiple
")
input(type="submit", value="전송")
\ No newline at end of file
...
...
views/directoryDeleteCheck.html
0 → 100644
View file @
2e4a39a
<script
type=
"text/javascript"
>
var
delete
=
confirm
(
"모든 이미지가 삭제됩니다.\n정말 분류를 삭제하시겠습니까?"
)
if
(
delete
)
window
.
location
.
href
=
window
.
location
+
'?real=true'
else
history
.
back
()
</script>
\ No newline at end of file
views/home.pug
View file @
2e4a39a
...
...
@@ -18,7 +18,7 @@ html
- var folderList=fileList
each folder in folderList
li=folder
form(action=folder method="get")
form(action=
"home/"+
folder method="get")
input(type="submit", value="편집")
form(action=
folder method="delete
")
form(action=
"home/"+folder+"/delete" method="get
")
input(type="submit", value="삭제")
\ No newline at end of file
...
...
Please
register
or
login
to post a comment