> For the complete documentation index, see [llms.txt](https://docs-cn.filswan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-cn.filswan.com/multichain.storage/developer-quickstart/sdk/python-mcs-sdk/shang-chuan-wen-jian.md).

# 上传文件

`McsAPI.upload_file(wallet_address, file_path)`

You can use the upload function to upload a single file to FilSwan IPFS gateway. The function takes your MetaMask wallet address and the absolute path of the file for upload.

```
def test_upload_file(wallet_info):
    wallet_address = wallet_info['wallet_address']

    api = McsAPI()
    # upload file to mcs
    file_path = "/*"
    upload_file = api.upload_file(wallet_address, file_path)
```

### Parameters

* wallet\_address: MetaMask wallet address.
* file\_path: Absolute path of the file for upload.

### Return

This function returns the upload API responses. This includes `source_file_upload_id`, `file_size` *and* `w_cid` that will be used for payments.

```
{
  status: 'success',
  data: {
    source_file_upload_id: <ID>,
    payload_cid: <'Qm...'>,
    ipfs_url: <'https://calibration-ipfs.filswan.com/ipfs/Qm...'>,
    file_size: <FILE_SIZE>,
    w_cid: <UNIQUE_CID>
  }
}
```
