Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload file result #604

Open
arbyruns opened this issue Nov 18, 2024 · 0 comments
Open

Upload file result #604

arbyruns opened this issue Nov 18, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@arbyruns
Copy link

Improve documentation

Link

https://supabase.com/docs/reference/swift/storage-from-download

Describe the problem

The documentation for file upload does not describe what the result looks like for a success or a failure. This makes it unclear what developers can expect from the API and how to handle the response effectively.

For example, using the following Swift code:

let fileName = "avatar1.png"

let result  = try await supabase.storage
  .from("avatars")
  .upload(
    path: "public/\(fileName)",
    file: fileData,
    options: FileOptions(
      cacheControl: "3600",
      contentType: "image/png",
      upsert: false
    )
  )

The result returned on success (I assume success) is:

(id = "8558a89d-9a60-4b74-9b09-5f007114cf9b", path = "Sample Title.jpg", fullPath = "storage/Sample Title.jpg")

Describe the improvement

However, there is no information on what the structure of the response will look like in the event of a failure, leaving developers uncertain about how to handle error scenarios.

Additional context

This creates a problem trying to do any follow up tasks based on a success or failure.

@arbyruns arbyruns added the documentation Improvements or additions to documentation label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant