Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  • Thread Tools
  • Rate This Thread
  1. #1
    New to the CF scene
    Join Date
    Apr 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uploadcare- really need help-simple stuff if you know your stuff

    i have a website that is very nearly complete. my last and final obsticle is image uploading. and as you can imagine as a noobie i have been through the thik and thin looking for a way to impliment uploading...(6.15 AM lol)i tried the hard way to begin with using php and got nowhere, i eventually stumbled upon a widget embedment UPLOADCARE...

    i am now using jscript to display the image.. however i have 1 issue...

    instead of displaying the image, all im getting is the text/ascii displayed UUID/URL rather than it being displayed as the img ...
    i know sumwhere its down to me using 2 jscript suggestions as i have sort of mixed the input part with another suggestion of onchange... so i basically really need sum1s help with a workaround...

    i would be most greatfull if anybody can offer me a quikfix and i will indeed place you within the website credits... thank you.

    here is the code...

    Code:
    <head>
    <script>UPLOADCARE_PUBLIC_KEY = "c557ad102b8e86698602";</script>
    <script src="https://ucarecdn.com/widget/2.8.2/uploadcare/uploadcare.full.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
    
    <script type="text/javascript">
    
    function imagepreview(input) {
    if (input.files && input.files[0]) {
    var filerd = new FileReader();
    filerd.onload=function (e) {
    $('#imgpreview').attr('src', e.target.result);
    };
    filerd.readAsDataURL(input.files[0]);
    }
    }
    </script>
    </head>
    
    </body>
    
    <div style="position:absolute; top:440; left:440;">
    <input type="file" name="my_file" onchange="imagepreview(this);" role="uploadcare-uploader" /><br/>
    <img id="imgpreview" alt="ImagePreview" />
    </div>
    
    </body>

    for the record. i can get it to work if i just use the input from my hardrive but when i ty to use the widget. it does not load...i did have it displaying just the ascii URL, but i changed it since to get it displaying from hardrive...

    but i really need to get it working from the widget....

    thanks in advance...really appreciate it...

    tried my best and am still at it. and will be until i get a fix lol, but its been a long journey getting this far......

    o.k after a little more playing around i have got this far....

    Code:
    <a>
    <img src="https://googledrive.com/host/0Bxl-mAg6AOVMOC1ub1M4alJNalE/newphone3.png" style ="position:absolute; top:765px; left:475px; width:148px; height:275px; border:0; z-index:99;" ></a>
    
    <div style="position:absolute; top:755px; left:650px;">
    <input type="hidden" name="my_file" role="uploadcare-uploader" onchange="imagepreview(this);" /><br/>
    <img id="imgpreview" alt="ImagePreview" style="position:absolute; top;10px; left:-168px; height:212px; width:134px; z-index:999;" />
    </div>
    but still wont preview the image.....not sure where to go from here as i have expired all options that i am capeable of at present...could really do with a little advice....thanks
    Last edited by VIPStephan; 04-30-2016 at 11:59 AM. Reason: added code BB tags, corrected typo


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •