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

396
Visualizações
FILEPOND SERVER LOAD

I am working with Filepond to upload images asynchronously and have an update page to retrieve the already uploaded files. Now to retrieve a file already uploaded, we have to configure the file property and have to pass server file reference. Now my question is on load function of the server property I want to change the name of the server file reference with the name of the file. As in, on the update page I am loading the already uploaded image and want to change the source option with the filename of the file being loaded, so that on the update I can check if this is a new file or not.

Here is my pond

$("#ios-icon-pond").filepond({
    ...common_icon_properties,
    name: "app_submission_form[ios_app_icon]",
    className: "ios_icon_pond",
    labelFileProcessingError: (response) => {
        return serverResponse.message;
    },
    labelFileLoadError: (response) => {
        return serverResponse;
    },
    files: is_ios_new_record
        ? null
        : [
                {
                    // the server file reference
                    source: "ios_app_icon",
                    // set type to local to indicate an already uploaded file
                    options: {
                        type: "local",
                    },
                },
          ],
    server: {
        process: {
            url: "/app_submission_form_uploads",
            method: "POST",
            headers: {
                "X-Form-Type": "ios",
                "X-Image-Type": "ios_app_icon",
                "X-CSRF-Token": $('meta[name="csrf-token"]').attr("content"),
            },
            onerror: (response) => {
                serverResponse = JSON.parse(response);
            },
        },
        load: is_ios_new_record
            ? null
            : {
                    url: "/app_submission_form_uploads",
                    method: "get",
                    headers: {
                        "X-Image-Type": "ios_app_icon",
                        "X-CSRF-Token": $('meta[name="csrf-token"]').attr("content"),
                    },
                    onerror: (response) => {
                        serverResponse = "File not found";
                    },
                    // onload: (response) => {
                    //  // debugger;
                    // },
              },
        revert: null,
        fetch: null,
    },
});

In the above code, we have the server configuration, and it have a load property. What I want it on load, I want to change the source property(Server File reference) of the files object with the filename being loaded.

about 4 years ago · Juan Pablo Isaza
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