https://supabase.com/ logo
Join Discord
Powered by
# python
  • j

    J0

    09/22/2021, 7:53 PM
    Sorry for the delayed reply @User . Yeah the use case makes sense. So if I understand you corectly, you would do
    .upload(<some string>, "folder1/file.xml")
    and then
    folder/file.xml
    would contain ?
  • d

    dreinon

    09/22/2021, 7:56 PM
    Yes
  • d

    dreinon

    09/22/2021, 7:56 PM
    It's actually a bytes string
  • d

    dreinon

    09/22/2021, 7:56 PM
    b''
  • d

    dreinon

    09/22/2021, 7:59 PM
    I couldn't try because I didn't know the syntax
  • d

    dreinon

    09/22/2021, 7:59 PM
    When you say .upload, what goes before to specify the bucket?
  • d

    dreinon

    09/22/2021, 7:59 PM
    Is it .storage('bucket').upload?
  • j

    J0

    09/23/2021, 3:06 PM
    yup! Uh it's not an existing feature I believe
  • j

    J0

    09/23/2021, 3:06 PM
    I'm about to add it
  • d

    dreinon

    09/23/2021, 10:36 PM
    Nice :) I'll be waiting for it!
  • j

    John Phamous

    10/04/2021, 12:07 AM
    👋 Will there be a new release that includes the storage/bucket functionality?
  • j

    J0

    10/04/2021, 12:10 AM
    yep!
  • j

    John Phamous

    10/04/2021, 12:10 AM
    Will that be out soon-ish? I wanted to use it for the hackathon.
  • j

    J0

    10/04/2021, 12:10 AM
    one sec
  • j

    J0

    10/04/2021, 12:13 AM
    We can publish storage file today(within the next few hours), but storage bucket can only be up earliest by end of tomorrow. Do you have a rough idea of which features you'll need?
  • j

    J0

    10/04/2021, 12:15 AM
    ah actually, yeah we can publish it today, sorry for the confusion.
  • j

    J0

    10/04/2021, 12:16 AM
    Let me get to it right now 🙂
  • j

    John Phamous

    10/04/2021, 12:17 AM
    Woohoo! Thanks a ton 🎉
  • j

    J0

    10/04/2021, 12:43 AM
    done, you should be able to access the latest features by doing
    pip3 install supabase
    (note the name change from
    supabase_py
    ->
    supabase
    ) please let me know if you run into issues /errors and I'll do my best to respond asap!
  • j

    J0

    10/04/2021, 12:43 AM
    Will publish an official release with notes etc later but you should be able to use that for now.
  • j

    John Phamous

    10/04/2021, 1:02 AM
    Thanks! Kind of stuck with the API. Here's what I have so far:
    Copy code
    supabase.storage().StorageFileAPI().upload('<BUCKET_NAME>/file.gif', './out/f.gif')
  • j

    John Phamous

    10/04/2021, 1:02 AM
    Looks like
    StorageFileAPI
    needs an id?
  • j

    John Phamous

    10/04/2021, 1:18 AM
    Nvm got it working!
    Copy code
    py
    resp = supabase.storage().StorageFileAPI('<BUCKET_NAME>').upload('<BUCKET_NAME>/<FILE_NAME>', '<FILE_PATH>')
  • j

    J0

    10/04/2021, 1:25 AM
    yep! Thanks for pointing that out! We'll update the documentation so it's clearer
  • j

    John Phamous

    10/04/2021, 1:35 AM
    I'm uploading an image but when viewing on Supabase and downloading the image then viewing, the image contents is getting rewritten to make it an invalid image. Is there something I'm missing?
    Copy code
    py
        resp = supabase.storage().StorageFileAPI('photos').upload('photos/mountain.png', './mountain.png', {
            "content-type": "image/png"
        })
  • j

    J0

    10/04/2021, 2:17 AM
    hm will take a look in a bit
  • j

    John Phamous

    10/04/2021, 2:21 AM
    Thanks!
  • j

    John Phamous

    10/04/2021, 2:23 AM
    Here's what I'm uploading:
  • j

    John Phamous

    10/04/2021, 2:23 AM
    Here's what I get from Supabase:
  • j

    John Phamous

    10/05/2021, 1:06 AM
    Hey @User , did you get a change to look at the problem?
12345...19Latest