Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

439
Visualizações
How to upload Bulk amount of json data with images to the firebase realtime and storage respectively

I have a bulk amount of data in CSV format. I am able to upload that data with python by converting them to the dictionary (dict) with loop. the whole data is getting uploaded.

but now I want to upload bulk data to firebase and images to storage and I want to link between each document and image because i am working on e-commerce react app. so that I can retrieve documents along with images.

which is a good way to do this? should I do this with javascript or python?

I uploaded data manually to firebase by importing from there but again I am unable to upload bulk images to storage and also unable to create references between them. please give me a source where I can find this solution

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This is tough, because it's hard to fully understand how exactly your images and CSV's are linked, but generally if you need to link something to items stored in Firebase, you can get a link either manually (go into storage, click and item, and the 'Name' Field on the right hand side is a link), or you can get it when you upload it. So for example, I have my images stored in firebase, and a postgres database with a table storing the locations. In my API (Express), when I post the image to blob storage, I create the URL of the item, and post that as an entry in my table, as well as setting it to be the blobs name. I'll put the code here, but obviously it's a completely different architecture to your problem, so i'll try and highlight the important bits (it's also JS, not Python, sorry!):

const uploadFile = async () => {
  var filename = "" + v4.v4() + ".png"; //uses the uuid library to create a unique value
  const options = {
    destination: filename,
    resumable: true,
    validation: "crc32c",
    metadata: {
      metadata: {
        firebaseStorageDownloadTokens: v4.v4(),
      },
    },
  };
  storage
    .bucket(bucketName)
    .upload(localFilename, options, function (err, file) {});

  pg.connect(connectionString, function (err, client, done) {
    client.query(
      `INSERT INTO table (image_location) VALUES ('${filename}')`, //inserts the filename we set earlier into the postgres table
      function (err, result) {
        done();

        if (err) return console.error(err);
        console.log(result.rows.length);
      }
    );
  });
  console.log(`${filename} uploaded to ${bucketName}.`);
};

Once you have a reference between the two like this, you can just get the one in the table first, then use that to pull in the other one using the location you have stored.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda