Wrote a proper env file system

This commit is contained in:
Jef Roosens 2022-02-21 20:40:13 +01:00
parent d6e71e9a1c
commit 1d434db166
Signed by untrusted user: Jef Roosens
GPG key ID: 955C0660072F691F
8 changed files with 128 additions and 56 deletions

View file

@ -58,10 +58,10 @@ fn (mut app App) put_package() web.Result {
if length := app.req.header.get(.content_length) {
// Generate a random filename for the temp file
pkg_path = os.join_path_single(app.dl_dir, rand.uuid_v4())
pkg_path = os.join_path_single(app.conf.download_dir, rand.uuid_v4())
for os.exists(pkg_path) {
pkg_path = os.join_path_single(app.dl_dir, rand.uuid_v4())
pkg_path = os.join_path_single(app.conf.download_dir, rand.uuid_v4())
}
app.ldebug("Uploading $length bytes (${pretty_bytes(length.int())}) to '$pkg_path'.")