Image Upload Preview Widget is not finishing the uploads

  • stretchandstaple
    Asked on November 23, 2015 at 2:15 PM

    The image upload preview widget is malfunctioning it just sticks on finishing upload and never finishes.  I am literally losing thousands of dollars a day as people can not purchase prints from us.

     

  • Ben
    Replied on November 23, 2015 at 3:56 PM

    I took a look at your form https://secure.jotformpro.com/form/51035094519958 on your website and for me it seems to be working properly:

    Image Upload Preview Widget is not finishing the uploads Image 1 Screenshot 20

    However as you can see this is a very small image, so I presume that your image (that was failing for you) is either larger, or the issue is no longer present.

    Can you please tell us if the issue is still present for you and if it is, is it still present for you if you upload your image over direct form - not the embedded one?

    I do want to point out that I had noticed that your iframe embed code (the script part that follows it to be precise) has some issues, so instead of this:

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = arg[1] + "px";break;case "collapseErrorPage":if (iframe.clientHeight &gt; window.innerHeight) {iframe.style.height = window.innerHeight + "px";}break;case "reloadPage":window.location.reload();break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    You should change it with this:

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = args[1] + "px";break;case "collapseErrorPage":if (iframe.clientHeight > window.innerHeight) {iframe.style.height = window.innerHeight + "px";}break;case "reloadPage":window.location.reload();break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    Once you do, it will help as it will resolve a js bug that happens each time your form needs to be resized.

  • stretchandstaple
    Replied on November 23, 2015 at 5:04 PM

    Hi,

    So I tried doing it directly on the form, not the embedded one and I am getting the same problem, try it with an image 6mb or larger and you will see what I mean.

    I have had this form live for over a year without any trouble, with the same script.

  • Kevin Support Team Lead
    Replied on November 23, 2015 at 7:50 PM

    Hi,

    Your issue has been replicated for one of my collegues, he has reported it to our developers..

    To assist you better, follow that thread, you will recieve news there : 

    http://www.jotform.com/answers/710435-Image-Upload-Preview-Widget-not-working-again

    Thanks.