Loading…

Upload files to network disk

# Get upload credentials ```javascript WXAPI.organizePanUploadGetSignature({ token: '00' }) ``` + token current user login credentials + organizeId organization ID + ext file suffix, such as .jpg .zip, etc., the decimal point cannot be omitted ```json { "code": 0, "msg": "success", "data": { "OSSAccessKeyId": "LTAIR5mTmPGi2qAM", "signature": "NvJ9ZIESwPLtuGqm2truXL5R7/s=", "success_action_status": 200, "host": "https://organize-pan.oss-cn-hangzhou.aliyuncs.com", "key": "615/2026/02/05/2159944e-4304-4c4c-967d-14602849f38d.txt", "policy": "eyJleHBpcmF0aW9uIjoiMjAyNi0wMi0wNVQxMTozMzozMy4yMTJaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMT A0ODU3NjAwMF0seyJrZXkiOiI2MTVcLzIwMjZcLzAyXC8wNVwvMjE1OTk0NGUtNDMwNC00YzRjLTk2N2QtMTQ2MDI4NDlmMzhkLnR4dCJ9XX0=" } } ``` + host The address of the file uploaded by the client. If it is WeChat Mini Program, the corresponding domain name needs to be added to the legal domain name of the uploaded file. + Other parameters, when the client uploads, all need to be passed to Alibaba Cloud as parameters, otherwise the upload will not be successful. # Upload files to OSS on the front end POST method, request the above `host` address, in addition to the above parameters, plus a file parameter: + Parameter name file. This parameter is required by Alibaba Cloud and must be passed as the last parameter, that is, placed below the above parameters. + Content-Type: multipart/form-data The status code returned by the request is 200, indicating that the upload is successful, otherwise the upload fails. Please note that here is the status code worth `status code` If it is WeChat Mini Program or the like, please use a method like `wx.upload` to upload it. # After the upload is successful, add the file to the network disk ```javascript WXAPI.organizePanUploadV2({ token: '00' }) ``` + token current user login credentials + name custom file name + organizeId organization ID + filePath here passes the key parameter returned by the first step interface + size file capacity (bytes), please obtain it after selecting the file on the client Please refer to uploading files [https://www.yuque.com/apifm/nu0f75/ygvqh6](https://www.yuque.com/apifm/nu0f75/ygvqh6)