PUT Part
API Description
After a multipart upload is initialized, you can use this API to upload a part to a specified bucket by using the multipart upload ID. Except for the last uploaded part whose size ranges from 0 to 5 GB, sizes of the other parts range from 100 KB to 5 GB. The upload part ID ranges from 1 to 10000.
Method Definition
func (obsClient ObsClient) UploadPart(input *UploadPartInput) (output *UploadPartOutput, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) UploadPartWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *UploadPartOutput, err error)
Request Parameter
Field |
Type |
Optional or Mandatory |
---|---|---|
input |
Mandatory |
Returned Result
Field |
Type |
---|---|
output |
|
err |
error |
Sample Code
func main() { input := &obs.UploadPartInput{} input.Bucket = "bucketname" input.Key = "objectkey" input.UploadId = "uploadid" input.PartNumber = 1 input.Body = strings.NewReader("Hello OBS") output, err := obsClient.UploadPart(input) if err == nil { fmt.Printf("RequestId:%s\n", output.RequestId) fmt.Printf("ETag:%s\n", output.ETag) } else { if obsError, ok := err.(obs.ObsError); ok { fmt.Println(obsError.Code) fmt.Println(obsError.Message) } else { fmt.Println(err) } } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot