Coder Social home page Coder Social logo

Comments (7)

dshukertjr avatar dshukertjr commented on June 16, 2024 4

Thanks @paurakhsharma for opening an issue!

Method to get public URL landed on supabase-js recently.
supabase/storage-js#10

I can try to get this implemented this weekend!

from supabase-dart.

phamhieu avatar phamhieu commented on June 16, 2024 2

@paurakhsharma can you check on your supabase project dashboard if journalImages is a public bucket? You can also copy the image public url on the dashboard and compare with generated version from the client. The generated url looks valid to me.

maybe you can try to rename your folder to use Only lowercase letters
Screenshot 2021-06-22 at 9 26 20 AM

from supabase-dart.

dshukertjr avatar dshukertjr commented on June 16, 2024 1

Hey @paurakhsharma !

By default all buckets created in Supabase are private. You can go into your Supabase console's storage setting and make buckets public!

from supabase-dart.

paurakhsharma avatar paurakhsharma commented on June 16, 2024 1

Thanks, @dshukertjr, and @phamhieu for the quick response.
Yes, my bucket wasn't set to public. Setting it to public worked like a charm 🚀

Many thanks.

from supabase-dart.

paurakhsharma avatar paurakhsharma commented on June 16, 2024

@dshukertjr That sounds awesome. Looking forward to it 😍

from supabase-dart.

phamhieu avatar phamhieu commented on June 16, 2024

@paurakhsharma, you can find the new public url feature on the latest version https://pub.dev/packages/supabase

from supabase-dart.

paurakhsharma avatar paurakhsharma commented on June 16, 2024

@dshukertjr @phamhieu
I am having some problem getting it to work, maybe I am missing something here:

Here is my code to get the publicUrl

Future<String?> uploadImage(PlatformFile file) async {
    final fileName = '${DateTime.now().toString()}_${file.name}';
    final response = await _client.storage.from('journalImages').upload(
          fileName,
          File(file.path!),
        );

    if (response.data == null) return null;
    final downloadUrl =
        _client.storage.from('journalImages').getPublicUrl(fileName).data;

    print(downloadUrl);

    return downloadUrl;

This the the URL that gets printed out: https://dlrvdojpksbdmvnygpeb.supabase.co/storage/v1/object/public/journalImages/2021-06-22%2007:58:17.902992_IMG_0005.jpeg

But it returns 404.

Anything I am missing?

from supabase-dart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.