Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -36,7 +36,9 @@ async def home():
|
|
| 36 |
async def upload_file(username: str, file_to_process: FileToProcess = Depends()):
|
| 37 |
uploaded_file = file_to_process.uploaded_file
|
| 38 |
print("File received:"+uploaded_file.filename)
|
| 39 |
-
print("File received:"+file_to_process.filename)
|
|
|
|
|
|
|
| 40 |
|
| 41 |
random_string = generate_random_string(20)
|
| 42 |
file_path = Path.cwd() / random_string
|
|
|
|
| 36 |
async def upload_file(username: str, file_to_process: FileToProcess = Depends()):
|
| 37 |
uploaded_file = file_to_process.uploaded_file
|
| 38 |
print("File received:"+uploaded_file.filename)
|
| 39 |
+
#print("File received:"+file_to_process.filename)
|
| 40 |
+
#`file_to_process`是`FileToProcess`类的一个实例,它具有一个名为`uploaded_file`的属性,而不是`filename`属性。
|
| 41 |
+
#因此,在打印`"File received:"+file_to_process.filename`时会引发`AttributeError`。
|
| 42 |
|
| 43 |
random_string = generate_random_string(20)
|
| 44 |
file_path = Path.cwd() / random_string
|