Vaibhav84 commited on
Commit
621b61f
·
1 Parent(s): 1e4a1c0
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -97,4 +97,17 @@ def ExtractSkills(skill_data: SkillDetails):
97
  def create_upload_file(file: bytes = File(...)):
98
  content = file.decode('utf-8')
99
  lines = content.split('\n')
100
- return {"content": lines}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  def create_upload_file(file: bytes = File(...)):
98
  content = file.decode('utf-8')
99
  lines = content.split('\n')
100
+ return {"content": lines}
101
+
102
+ @app.post("/uploadJobDescriptionPDF/")
103
+ def upload_PDF(file: UploadFile = File(...)):
104
+ try:
105
+ contents = file.file.read()
106
+ with open(file.filename, 'wb') as f:
107
+ f.write(contents)
108
+ except Exception:
109
+ return {"message": "There was an error uploading the file"}
110
+ finally:
111
+ file.file.close()
112
+
113
+ return {"message": f"Successfully uploaded {contents}"}