Giter Site home page Giter Site logo

Name of Saved File about uploader HOT 2 OPEN

Donkeh68 avatar Donkeh68 commented on June 11, 2024
Name of Saved File

from uploader.

Comments (2)

Donkeh68 avatar Donkeh68 commented on June 11, 2024 1

I managed to resolve this myself, so here are the steps, so as to help anyone else with the same problem:

  1. Create a holder for the file name
  • In the "files-template" section (within your HTML) add the attribute data-filepath="" to the li class="media" element
  1. Send the data to the template function on successful upload
  • In the "demo-config.js" file find the "onUploadSuccess" function
  • replace the line that says ui_multi_update_file_status(id, 'success', 'Upload Complete'); with ui_multi_update_file_status2(id, 'success', 'Upload Complete', JSON.stringify(data));
  1. Populate the template field
  • In the "demo-ui.js" file add the following function:
    function ui_multi_update_file_status2(id, status, message, response) {
    $('#uploaderFile' + id).find('span').html(message).prop('class', 'status text-' + status);
    // EXTRACT SAVED FILE NAME FROM RESPONSE
    var searchString = "files/";
    var indexBegin = response.indexOf(searchString) + searchString.length;
    var lengthResult = response.length - indexBegin - 2;
    var filePath = response.substr(indexBegin, lengthResult);
    // SET VALUE IN TEMPLATE
    $('#uploaderFile' + id).attr("data-filepath", filePath);
    }

Easy when you know how ;)

from uploader.

sahuadarsh0 avatar sahuadarsh0 commented on June 11, 2024

same here

from uploader.

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.