MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / save_file

Method save_file

core/storage.py:878–881  ·  view source on GitHub ↗
(self, file: UploadFile, save_path: str)

Source from the content-addressed store, hash-verified

876 )
877
878 async def save_file(self, file: UploadFile, save_path: str):
879 # 使用 asyncio.to_thread 避免阻塞事件循环
880 content = await asyncio.to_thread(file.file.read)
881 await self.operator.write(save_path, content)
882
883 async def delete_file(self, file_code: FileCodes):
884 await self.operator.delete(await file_code.get_file_path())

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected