|
|
|
@ -41,7 +41,7 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
|
|
|
|
status_code=400,
|
|
|
|
status_code=400,
|
|
|
|
detail=f"Invalid filename: {str(e)}"
|
|
|
|
detail=f"Invalid filename: {str(e)}"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Check if mime type is application/octet-stream
|
|
|
|
# Check if mime type is application/octet-stream
|
|
|
|
if file.content_type != "application/octet-stream":
|
|
|
|
if file.content_type != "application/octet-stream":
|
|
|
|
raise HTTPException(
|
|
|
|
raise HTTPException(
|
|
|
|
@ -65,6 +65,7 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
|
|
|
|
|
|
|
|
|
|
|
|
print("read file")
|
|
|
|
print("read file")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Read and check file size
|
|
|
|
# Read and check file size
|
|
|
|
content = await file.read()
|
|
|
|
content = await file.read()
|
|
|
|
if len(content) > MAX_FILE_SIZE:
|
|
|
|
if len(content) > MAX_FILE_SIZE:
|
|
|
|
@ -98,6 +99,8 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return clean_filename
|
|
|
|
|
|
|
|
|
|
|
|
# Project name hardcode
|
|
|
|
# Project name hardcode
|
|
|
|
# project_name = "trialapi"
|
|
|
|
# project_name = "trialapi"
|
|
|
|
|
|
|
|
|
|
|
|
|