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....
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....thanksCode:<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>



Reply With Quote
