diff --git a/src/app.py b/src/app.py index 5158c6c..21a82fd 100644 --- a/src/app.py +++ b/src/app.py @@ -14,6 +14,8 @@ from imageProcessEngine import imageProcess +from datetime import datetime + os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = "../gcp-auth.json" @@ -34,7 +36,19 @@ def main(): @app.post("/generateApp") async def main(file: UploadFile): - src = os.path.abspath("../results/source.png") + + now = datetime.now() + time_stamp = now.strftime("%H:%M:%S") + path = "../results/" + extension = "source.png" + + path += time_stamp + path += "/" + os.mkdir(path) + path += extension + src = os.path.abspath(path) + + # src = os.path.abspath("../results/source.png") with open(src, "wb") as buffer: shutil.copyfileobj(file.file, buffer) # data = await file.read()