Skip to content

[Storage] Add support for 'download' parameter to CreateSignedUrl, CreateSignedUrls and GetPublicUrl #17

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

Open
ninoalloy opened this issue Jul 30, 2024 · 0 comments · May be fixed by #20
Labels
enhancement New feature or request

Comments

@ninoalloy
Copy link

Feature request

Looking at the docs for the JS Sdk (https://supabase.com/docs/reference/javascript/storage-from-createsignedurl) under options, it is possible to provide a download request parameter to control whether the resulting URL(s) triggers or not a download in the browser.

This option does not seem to be currently supported by the C# Sdk.

Describe the solution you'd like

The download parameter should be added to the accepted parameters of all 3 methods mentioned above.

image
However download in the JS Sdk can either be a bool or a string to give the possibility to override the downloaded file name.

The implementation choices I can think of are:

  1. Add a DownloadOptions class:
    If Download is set to false (FileNameOverride is ignored), then a link without download headers is generated.
    If Download is set to true and FileNameOverride is provided, then a link with download headers and overridden file name is generated.
    If Download is set to true and FileNameOverride is null or empty, then a link with download headers and default file name is generated.
public class DownloadOptions
{
    public bool Download { get; }
    public string? FileNameOverride { get; }
}
  1. Add a method override for each of the 3 methods above with a bool download parameter and a string? fileNameOverride one. Same rules as choice 1 apply.

Describe alternatives you've considered

I cannot think of any alternative other than contacting the Supabase Api directly.

Additional context

I would be happy to implement the feature and open a PR once we have reached consensus on a design.

@ninoalloy ninoalloy added the enhancement New feature or request label Jul 30, 2024
@MagnusHJensen MagnusHJensen linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant