Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc20c58
commit 594b736
Showing
11 changed files
with
274 additions
and
28 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
if (isset($_FILES['inputFile'])){ | ||
//checks for errors and checks that file is uploaded | ||
if ($_FILES['inputFile']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['inputFile']['tmp_name'])) | ||
{ | ||
echo file_get_contents($_FILES['inputFile']['tmp_name']); | ||
} | ||
else | ||
{ | ||
echo 'Unable to load this file...'; | ||
} | ||
} else { | ||
echo 'No file found...'; | ||
} | ||
?> |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
include 'util/sessions.php'; | ||
|
||
initConnections(); | ||
|
||
if ($isConnected) | ||
{ | ||
if (isset($_POST['content']) && isset($_POST['subdirectory']) && isset($_POST['fileName'])) { | ||
$filePath = "/stockage/data/".$_POST['subdirectory'].$_POST['fileName']; | ||
$file = fopen($filePath, "w"); | ||
if (!$file) { | ||
throw new Exception("Unable to create the file at path : \"".$filePath."\""); | ||
} else { | ||
fputs($file, $_POST['content']); | ||
fclose($file); | ||
} | ||
} else { | ||
throw new Exception('Any content to save...'); | ||
} | ||
} else { | ||
throw new Exception("You don't have administrator rights...."); | ||
} | ||
?> |
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,4 +1,4 @@ | ||
<?php | ||
<?php | ||
// identifiants de connexion en local : | ||
define('LOGIN', "root"); | ||
define('PASSWORD', ""); | ||
|
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
Oops, something went wrong.