// Update in to the object
Update in to the object
// Update in to the object
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
	err := o.fs.Mkdir(ctx, "")
	if err != nil {
		return err
	}
	key := o.fs.root + o.remote
	mimeType := fs.MimeType(ctx, src)
	req := uploadInput{
		body:        in,
		qsSvc:       o.fs.svc,
		bucket:      o.fs.bucket,
		zone:        o.fs.zone,
		key:         key,
		mimeType:    mimeType,
		partSize:    int64(o.fs.opt.ChunkSize),
		concurrency: o.fs.opt.UploadConcurrency,
	}
	uploader := newUploader(&req)
	size := src.Size()
	multipart := size < 0 || size >= int64(o.fs.opt.UploadCutoff)
	if multipart {
		err = uploader.upload()
	} else {
		err = uploader.singlePartUpload(in, size)
	}
	if err != nil {
		return err
	}
	err = o.readMetaData()
	return err
}
func ( o * Object ) Update ( ctx context . Context , in io . Reader , src fs . ObjectInfo , options ... fs . OpenOption ) error { err := o . fs . Mkdir ( ctx , " " ) if err != nil { return err } key := o . fs . root + o . remote mimeType := fs . MimeType ( ctx , src ) req := uploadInput { body : in , qsSvc : o . fs . svc , bucket : o . fs . bucket , zone : o . fs . zone , key : key , mimeType : mimeType , partSize : int64 ( o . fs . opt . ChunkSize ) , concurrency : o . fs . opt . UploadConcurrency , } uploader := newUploader ( & req ) size := src . Size ( ) multipart := size < 0 || size >= int64 ( o . fs . opt . UploadCutoff ) if multipart { err = uploader . upload ( ) } else { err = uploader . singlePartUpload ( in , size ) } if err != nil { return err } err = o . readMetaData ( ) return err }
Update in to the object
Update in to the object
// The maximum size of upload object is multipartUploadSize * MaxMultipleParts // Guess the content type // Read Metadata of object