|
@@ -4,7 +4,6 @@ import (
|
|
|
"crypto/sha256"
|
|
|
"encoding/hex"
|
|
|
"encoding/json"
|
|
|
- "fmt"
|
|
|
"io"
|
|
|
"log"
|
|
|
"math"
|
|
@@ -561,7 +560,6 @@ func system_fs_handleLowMemoryUpload(w http.ResponseWriter, r *http.Request) {
|
|
|
if fsh.RequireBuffer {
|
|
|
mergeFileLocation = getFsBufferFilepath(decodedUploadLocation, false)
|
|
|
}
|
|
|
- fmt.Println(mergeFileLocation)
|
|
|
out, err := os.OpenFile(mergeFileLocation, os.O_CREATE|os.O_WRONLY, 0755)
|
|
|
if err != nil {
|
|
|
log.Println("Failed to open file:", err)
|
|
@@ -3042,28 +3040,6 @@ func system_fs_handleFilePermission(w http.ResponseWriter, r *http.Request) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//Check if the given filepath is and must inside the given directory path.
|
|
|
-//You can pass both as relative
|
|
|
-func system_fs_checkFileInDirectory(filesourcepath string, directory string) bool {
|
|
|
- filepathAbs, err := filepath.Abs(filesourcepath)
|
|
|
- if err != nil {
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
- directoryAbs, err := filepath.Abs(directory)
|
|
|
- if err != nil {
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
- //Check if the filepathabs contain directoryAbs
|
|
|
- if strings.Contains(filepathAbs, directoryAbs) {
|
|
|
- return true
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
//Clear the old files inside the tmp file
|
|
|
func system_fs_clearOldTmpFiles() {
|
|
|
filesToBeDelete := []string{}
|