appwrite/docs/examples/0.13.x/server-swift/examples/storage/get-file.md

16 lines
450 B
Markdown
Raw Normal View History

2022-01-30 09:29:52 +00:00
import Appwrite
2022-04-12 05:35:53 +00:00
func main() async throws {
2022-01-30 09:29:52 +00:00
let client = Client()
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let storage = Storage(client)
2022-04-12 05:35:53 +00:00
let file = try await storage.getFile(
2022-01-30 09:29:52 +00:00
bucketId: "[BUCKET_ID]",
fileId: "[FILE_ID]"
2022-04-12 05:35:53 +00:00
)
print(String(describing: file)
2022-01-30 09:29:52 +00:00
}