Ejemplo n.º 1
0
def UploadToFirebase(data, path):
    APIRUI = 'https://firebasestorage.googleapis.com/v0/b/' + getFirebaseBucketName(
    ) + "/o/" + path.replace('/', '%2F')

    headers = {"Content-Type": "img/jpg"}

    result = requests.post(APIRUI, headers=headers, data=data)
    return (APIRUI + "?alt=media&token=" + result.json()['downloadTokens'])
Ejemplo n.º 2
0
def UploadToFirebase(data, path):
    #https://firebasestorage.googleapis.com/v0/b/monolith-6154f.appspot.com/o/shareX%2F$filename$
    APIRUI = 'https://firebasestorage.googleapis.com/v0/b/' + getFirebaseBucketName(
    ) + "/o/" + path.replace('/', '%2F')

    headers = {"Content-Type": "img/jpg"}

    result = requests.post(APIRUI, headers=headers, data=data)
    #print (APIRUI + "?alt=media&token=" + result.json()['downloadTokens'])
    # https://firebasestorage.googleapis.com/v0/b/monolith-6154f.appspot.com/o/assets%2F202102091338.jpg?alt=media&token=95ace281-fa00-42f8-837a-8f80e6bc4ca9
    return (APIRUI + "?alt=media&token=" + result.json()['downloadTokens'])