mitulagr2 commited on
Commit
31c1d58
1 Parent(s): cf20412

Update main.py

Browse files
Files changed (1) hide show
  1. app/main.py +3 -2
app/main.py CHANGED
@@ -58,10 +58,11 @@ async def parse_body(request: Request):
58
  return data
59
 
60
  @app.post("/upload")
61
- def upload(data: bytes = Depends(parse_body)):
 
62
  if data:
63
  try:
64
- path = f"{files_dir}/file.pdf"
65
  with open(path, "wb") as f:
66
  f.write(data)
67
  session_assistant.ingest(files_dir)
 
58
  return data
59
 
60
  @app.post("/upload")
61
+ def upload(filename: str, data: bytes = Depends(parse_body)):
62
+ print("Filename: " + filename)
63
  if data:
64
  try:
65
+ path = f"{files_dir}/{filename}"
66
  with open(path, "wb") as f:
67
  f.write(data)
68
  session_assistant.ingest(files_dir)