Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sfcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush
sfcode
Commits
30c684ba
Commit
30c684ba
authored
Dec 04, 2020
by
Paarth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filesave.php and newdir.php added
parent
49246421
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
7 deletions
+78
-7
angular.json
angular.json
+13
-7
backend/filesave.php
backend/filesave.php
+45
-0
backend/newdir.php
backend/newdir.php
+20
-0
No files found.
angular.json
View file @
30c684ba
...
@@ -41,10 +41,12 @@
...
@@ -41,10 +41,12 @@
},
},
"configurations"
:
{
"configurations"
:
{
"production"
:
{
"production"
:
{
"fileReplacements"
:
[{
"fileReplacements"
:
[
{
"replace"
:
"src/environments/environment.ts"
,
"replace"
:
"src/environments/environment.ts"
,
"with"
:
"src/environments/environment.prod.ts"
"with"
:
"src/environments/environment.prod.ts"
}],
}
],
"optimization"
:
true
,
"optimization"
:
true
,
"outputHashing"
:
"all"
,
"outputHashing"
:
"all"
,
"sourceMap"
:
false
,
"sourceMap"
:
false
,
...
@@ -53,7 +55,8 @@
...
@@ -53,7 +55,8 @@
"extractLicenses"
:
true
,
"extractLicenses"
:
true
,
"vendorChunk"
:
false
,
"vendorChunk"
:
false
,
"buildOptimizer"
:
true
,
"buildOptimizer"
:
true
,
"budgets"
:
[{
"budgets"
:
[
{
"type"
:
"initial"
,
"type"
:
"initial"
,
"maximumWarning"
:
"2mb"
,
"maximumWarning"
:
"2mb"
,
"maximumError"
:
"5mb"
"maximumError"
:
"5mb"
...
@@ -133,5 +136,8 @@
...
@@ -133,5 +136,8 @@
}
}
}
}
},
},
"defaultProject"
:
"temp"
"defaultProject"
:
"temp"
,
"cli"
:
{
"analytics"
:
false
}
}
}
\ No newline at end of file
backend/filesave.php
0 → 100644
View file @
30c684ba
<?php
include_once
(
"database.php"
)
$postData
=
file_get_contents
(
"php://input"
);
if
(
isset
(
$postData
)
&&
!
empty
(
$postData
))
{
$request
=
json_decode
(
$postData
);
$username
=
trim
(
$request
->
username
);
$data
=
trim
(
$request
->
File
.
text
);
$filename
=
trim
(
$request
->
File
.
filename
);
$lang
=
trim
(
$request
->
File
.
language
);
$path
=
trim
(
$request
->
File
.
path
)
.
'/'
.
$filename
;
if
(
file_exists
(
$path
))
{
$msg
=
"file already exists"
;
clearstatcache
();
echo
json_encode
(
$msg
);
}
else
{
$sql1
=
"SELECT n_files from userdata where username =
$username
"
;
$sql2
=
"UPDATE userdata SET n_files = n_files+1 WHERE username =
$username
"
;
$result
=
mysqli_query
(
$mysqli
,
$sql1
);
if
(
$result
==
10
){
$msg
=
"maximum limit(10) exceeded"
;
echo
json_encode
(
$msg
);
}
else
{
if
(
$result
=
mysqli_query
(
$mysqli
,
$sql2
))
{
$myfile
=
fopen
(
$path
,
"w"
);
fwrite
(
$myfile
,
$data
);
fclose
(
$myfile
);
$msg
=
"file successfully uploaded"
;
clearstatcache
();
echo
json_encode
(
$msg
);
}
else
{
http_response_code
(
404
);
}
}
}
}
?>
\ No newline at end of file
backend/newdir.php
0 → 100644
View file @
30c684ba
<?php
$postData
=
file_get_contents
(
"php://input"
);
if
(
isset
(
$postData
)
&&
!
empty
(
$postData
))
{
$request
=
json_decode
(
$postData
);
// $username = trim($request->username);
$dir
=
trim
(
$request
->
dir
);
$path
=
trim
(
$request
->
currdir
)
.
'/'
.
$dir
;
if
(
file_exists
(
$path
))
{
$msg
=
"directory already exists"
;
clearstatcache
();
echo
json_encode
(
$msg
);
}
else
{
mkdir
(
$path
);
clearstatcache
();
}
}
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment