2019-10-19 07:42:02 +13:00
|
|
|
# Storage Examples
|
|
|
|
|
|
|
|
## UpdateFile
|
|
|
|
|
|
|
|
```go
|
|
|
|
package appwrite-updatefile
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"github.com/appwrite/sdk-for-go"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
// Create a Client
|
|
|
|
var clt := appwrite.Client{}
|
|
|
|
|
|
|
|
// Set Client required headers
|
|
|
|
clt.SetProject("")
|
|
|
|
clt.SetKey("")
|
|
|
|
|
|
|
|
// Create a new Storage service passing Client
|
|
|
|
var srv := appwrite.Storage{
|
|
|
|
client: &clt
|
|
|
|
}
|
|
|
|
|
|
|
|
// Call UpdateFile method and handle results
|
2019-10-22 06:15:27 +13:00
|
|
|
var res, err := srv.UpdateFile("[FILE_ID]", [], [])
|
2019-10-19 07:42:02 +13:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println(res)
|
|
|
|
}
|
|
|
|
```
|