这在我的本地部署中很好,但在云部署上却不起作用。
with open(file_path, "wb+") as fp:
for chunk in file:
fp.write(chunk)
result = upload.delay(name, file_path)
在另一个文件中:
@shared_task
def upload(name, file_path):
path = Path(path_tmp)
if os.path.isfile(path):
do something
错误是
非路径/mediafile