0

Good day

I'm using Oracle Application Express 5.1.4.00.08, and i got a problem, i need to show an image that not upload yet, i get some javascript code and tried to put in by Dynamic Action with no success, does anyone knows how to do that?

Dmitriy
  • 5,525
  • 12
  • 25
  • 38
Amorim Diniz
  • 1
  • 1
  • 3
  • Which operating system is it? On MS Windows, you don't have to do anything. When you click the "Browse" button, the "File upload" windows opens and lets you choose file you'd like to upload. In that window, in upper-right corner, there's the "Show the preview pane" button, so - enable it. Once you do it & click any file, you'll see its preview. If it is not Windows, sorry - no idea. – Littlefoot Mar 14 '18 at 19:38
  • 1
    https://stackoverflow.com/questions/14069421/show-an-image-preview-before-upload – romeuBraga Mar 15 '18 at 00:08

1 Answers1

1

Add a container

<img id="image_region" src="#" alt="your image" />

Add that code in a dynamic action source your file browser:

 var reader = new FileReader();

    reader.onload = function (e) {
        $('#image_region')
            .attr('src', e.target.result)
            .width(150)
            .height(150);
    };

    reader.readAsDataURL(this.triggeringElement.files[0]); 
Gibolt
  • 42,564
  • 15
  • 187
  • 127