Help with Standalone Downloader App



  • Hi guys, super stuck with this one, and don't really understand the server side of things so any help would be amazing! I'm attempting to build a simple standalone downloader - you click a button and it downloads a file into your downloads folder.

    At the moment it works once in HISE. Once the file is downloaded it won't download again, even if that file is deleted.

    Once compiled into a standalone app it doesn't really work at all. I managed to get it to download once, but that was it 😆

    Where am I going wrong? I've used the example @Christoph-Hart put in the Docs... Snippet below

    HiseSnippet 1164.3ocsV0saaaCElJwZs1adXEa6tcAgtRF0SwJMasnAA00+sYTmDi5j1dW.iDsMQjHMjnRiQP.5ixdT1izdC1NThxVN0IKv.wAvwjmy4ieme34vgQBOZbrHBYT9j4ynHiuybzbtbZ6oDFG0uCx3GM8CDDerjFKwt3orXJp07Yj3XpOxvX6+PonQ4RnzO+yaZQBHbO5xsPnOHXdzArPlb4tCa9NVPPOhO8DVXAs2qYeOAusHPj.jZayFnYDuKHSnGQTpskIx3a55yjhnQRBvIjQoVB+4ilJ9LOS+OvhYmGPUKbQi.fx1tmHvWwX0tn1SYA9Cyc9XDfxvkghsyBE+j4gLe1h8WFR9gTA3kVTLdXr08QO2hzqwCmdFEnWoL58LyQdQrYxkRTb6aM6ykznwDuUSSY5h15mKY1V.ZvkNgjKn8hfEKrv9EMZTGu6qZTa+pUfz.jwujDgGPNmF3hO.ma4DprsHblfCKrsxDaoroZkQznKoQNwTYKRL8z2Ov1ZpTN606ripxwgj3yDVqBujDA.Bv2iEPGMOVRCUmPZDIxtvlcffnpVLtVJCTAIkTaq+r+ntm4p9ygdEUyDFOfwo3wIbOISvwBdqDoTvcUdQjHv1K2EpCzHHgVqZkqqVACex7HkSXaIoWIspisfv7jHHN633jd.J8XisSs7fCbqksSJDk0AAeMeyHY9pctEaqiu9l55fP8Ez0tlxGz7QEkBgyFtF.gIKq8yOL024Bd9A3t7IfKCmaBTgchXjLhwmXKgHuiOQRb3Ig4wPpOdGraic2yowheTG6l6YE.05vVfFV3m+Pf+DgjDrdjA..nx49ZBw5yLmBPZJVDPclAmhz9VBwKR.KO9wLNKdJ0WmJveMHK0MNQcmA+FrUGnDvB+ZrUOBKPW5bi9e5uVeYutZxplxIz0TsIAAmC8qrucwVFfEpEORHoGCY4JWWobkapfusnwiWqLMbAvEi0IV0KM59LzFxQmSixq3yUDZprZWKy6tqUwlpdYQlBJJ384L4wyn76pWFRGNgecZ+NPxP0dSuGn2LZjjonfQG5kvbirlckM6PiuPJlAntHGfLdhLU52qaElEyQLekA5D.5pECW96SaNewhubZSJm.9jpW9.JIRO9fEenHD.mDMOyChIWR6yGB28oxLUPEXfYFCppYPZYcJAdpYVI9cd9m0TU2qLsPqkUv9I+OXuaArQur.1n80X+KlsGzu86vmbLtywe7nAG+1NXU6GmtepK5yLe4zE17WgMmRYSltbF8WZ0D80icfgeB+j.hb0IhpmAnE.EbqL5QMdgGyjyK9LgGkwjOT59LygLo2z0y2sVCegRzGa9pezQUytiGS8jKIaIyde5w+EFn2KRjP67CIPWcnrx7njvQvav7n.S3bZfpofwVpquYqanVqhLinb+zE+K7QKzUs1PKzMWHJj3EINyKqUj5YMOMcGfS7zW2U17P0ZrKJs8DXmYCmFnP3F5YddpPwuBbe81r6FXyK1.a1aCr421.a98MvlWtA17p60FUyw2lHEgYWSfMF1MsmsgQ2ztmoUjn+CCKkki
    

    Many thanks for any help / advice / examples offered.

    Cheers! 🙂





  • @d-healey Thanks, I've tried some of the other commands including this and get this error:

    Interface:! Line 10, column 34: Function / constant not found: Server.cleanFinishedDownloads
    

    Assume I'm using it wrong!



  • @DanH said in Help with Standalone Downloader App:

    Assume I'm using it wrong!

    Probably. You'd need to show me where you're using it.

    You should setup a test server (XAMPP) while you're developing.



  • @d-healey Here's where I've put it (in the button callback) in the snippet below

    HiseSnippet 1173.3ocsV0saaaCElJIZs1adXEaWtKHzUJndJVoYqEsHnt9uMiZmXTmz06BXjnsHhDogDUZLBBPeT1ixdj1av1gRT1xoNYAFHN.Nl77C+N+vuCGEK7nIIhXjQkSlOihL9Nywy4xf1ADFG0uCx3GM8CEDerjlHw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ZvwuqCVQ+3z8ScQel4KCVXyeE0LfxlFrbn9WZ0D80yofokB+zPhb0Qnp2MnE.MbqLqRMOhmvjyK+thGk4pOT39LyQLoWv5w6VqAuPK5iMd0uRolY2ISndxkfcGyde5w+IInOHRk.c9PBvpCsUlGkFMFdzlGEPBmSCUjBFaot9lutgZsJyLlx8yV7uvGsPW0ZCsP2BgnHhWr3LubpH06fdZ1N.l3YOGrh4P0ZrKJidBryrgSCTDbC8LOOUp3W.ruda1eCr4EafMGrA17qafM+1FXyK2.ad08Zihb7coRQT90DXiQcy3rML5lwdl0Qh9O.0QdlT
    


  • Your button is momentary, so the callback is triggered twice; once when you press the button and once when you release the mouse. So you are cleaning the downloads while you are downloading, that will probably cause a problem. You should put the function call inside the if statement. And tidy up your brackets and indentation a bit to make it easier to read.



  • @d-healey Done and done... still no joy though 🤔

    HiseSnippet 1170.3ocsV0saaaCElJIZq1adXEaWtKHzUxndJ1oYqEMnnt9uMi5jXTmz16BXjnsHhDogDUZLBBPeT1ixdj1av1gRTVxoNYAFHx.Vh77C+324vygiiDtz3XQDxnxIKlSQFeu4jEboeWeBiiF1CY7SldABhGVRik3VXeVLE0YwbRbL0CYXr8enTznxNnzm+4McHADtKsXJD5CBlKcDKjIKlcb62wBBFP7nmvBKo89sG5J3cEAhD.Taa1DMm3dAYF8HhRssLQFeSeOlTDMQR.LgL1oivawDewm4Y5+AVL67.pZPKzDvQYSOPD3oPrZVTWeVf237MeLB7x3BpX6Lp3mMOj4wVNeAk7ioBvEVTlOL159fWqxvq4CGdFkf2NYv6olSbiXykERTX66LGxkznoD2UCSY5h1huiYWAnAW5DRtfNHBFrzB6m2rYC7durY8CpUEBCPD+RRDdD4bZPK7qw4VNiJ6JBmK3v.aqLwVJapUcBM5RZjSLU1gDSO88irs7kx4uZ2cUYNNjDOlvZU2KIQfCA2OfEPmrHVRCUqPJiDYWZxd.IpxEiqmh.EIojZa8mCmz+rVpeNzqnZjv3ALNEOMg6JYBNVv6jHkBdK0tHRDX6luEZ.vHHgVuV0qqUECO5WpmrMmZ+XaIoWIsZfs.FeVDP4NNNoqkRuaxdU9e1T6b+lM4W6cMa4FPI7ALNK1m5sbWZWeUOWQqsmVgr8d9ncuEIz.e8MMzbaikrfccE0nQfh7Cg8Ab5BXeKqCJi9bAO60397Y.SBqaBj3dhXhLhwmYKg.piGQRb3Ig4fl5g2E2p4d66zb4GMvsxYoRN05vNfFV3m8Pb+IBIIX8dFb.3pbrulvkdMyg.D8iEATm4vpHsukvhHWwxOUGWpWD1tkSJzMNQcTD+FrUOHyxB+Jr0.BKPmQdi90x+V+4IcZpUc01Pmr1kDDbNTHz91YwYtrTR9QBI8XHNW85pUpdSU7sEMc5ZkocW.bhachUEoitOCsgnz4zn7iR4JBUqVsbn4cWNrb0Z2LlojhB9PNSd7bJ+tJRhzzI70oC6AgCUcS8bfdyoQRlBBF8nWBMjxphVwrGM9BoXN30kw.nGiLU5Onqwlw4Hlmx.c..c0xtV+8osWrbvWNsMkSf8jpIwHJIR2WJlbIcHeLT3fJylAUZAMyVvZ5ELMONc8dhYVN8ctbm0VknqLsTcoU7829+368J4azKJ4azAZe+KlcGMr66vmbLt2we7nQG+1dXU8Fm9epO5yLOo+Ra9qv19T1L+hd8eoSazW29BZhJ7RBHxU6rptNgV.jesRKLUaJdLStn70MdTZ29Pg6SMGyjt9qGuasF7BYjO13Ue4kZl8mNk5JK.6NlC9zi+MUPuWjHg52GRfx3PZk4QIgSf6x4RAjv4z.UM.isTmVyF2TMVwLSnbuzA+K7nE1RM1PKrUtPTHwMRblaVkG00idR5L.l3o2Rrh4gpw3VnzpQfclMcZhBgCjm45pnheEv95sYuMvlmuA1r+FXyusA176afMuXCr4k2qMpZguMQJByNl.SLteZIZCi9oEKSyHQ+mWucV5
    


  • Tidy up your brackets and indendation, then you might see why it doesn't work 🙂



  • @d-healey I thought I had 😂



  • @d-healey Can't figure it out 😕



  • @DanH said in Help with Standalone Downloader App:

    @d-healey I thought I had 😂

    Well your brackets are all messed up, so once they are tidy you will see the issue there.
    Also it's a good idea to end your lines with a semi-colon 😉



  • @d-healey said in Help with Standalone Downloader App:

    Also it's a good idea to end your lines with a semi-colon 😉

    ah the classics



  • @d-healey I tried the braces everywhere and the semi-colons... will try again!



  • @DanH said in Help with Standalone Downloader App:

    @d-healey I tried the braces everywhere

    Just put them where they are needed 😉



  • @d-healey I still get the error

    Interface:! Line 10, column 34: Function / constant not found: Server.cleanFinishedDownloads
    
    

    wherever I put

    Server.cleanFinishedDownloads()
    

    Stumped!🏏

    HiseSnippet 1179.3ocsV0kaaaDDdosXaDaUQCZerOPvmnPToEcbaBpgQUzesBQ1VHzN0uYrlbk3BStq.4RGKXXfbT5Qo2jdE5MncV9iHkprig.BMfgl++lYmclcRD2kDGyiPJ0OawbBR4qUcVvD987wTFZTejx2o5Evwd5BRrP2V2mFSPcWLGGGS7PJJ69aREUpWCk98O+ZWb.l4RJYgPumScIiogTQI2IcdKMHXH1ibFMrh1GzYjKm0iGvS.PsqZazbr603YjSvR01QEo7EC7nBdji.CXBoTqK2agiO+CrL8eOMldU.QRXib.GkwdHOvShXIWTOeZf2jhjOFAdYRYoX2rRw2qdL0itjeYI4aSEnWZQ05gxNOF7rqBu1Oc3oTAd0xf2yUcbinyEkRjX6qTGwDjnoX2UOlxzEsyE0T6wAMXBqP70jgQ.wRKLeY61sz2+0sadXCM3X.NwuAGoOFeEIvV+H8BKmQD83gy4LfvzHSrgzlFZNjnaHQVwDQWbL472M1zvWHl+K6smrywBm3Q4Fq5dANBbH39gz.hyhXAITFgzJRjYEl8ghnrWLtYJBjEIoTSieejyfKsk+YQtkjiDJKfxH5SSXtBJmoyYcSDBNyVlEQ7.S2hTnE.ifDRyFZ20PSG9x9OcpYJ+iNxtYFmRY2UxHOicCHX1PJiF6S7VhTylGpUp5JteM68xMIKiJn1asTqk9c22Juh0ZYtY1bUWdWCsUYHKygPSBbOBpyFFGtIfTnvKNRe.aFT6.Lk.spmwcDQT1LSAbDZ4gEXKVRXQJR7z2S2t89GX0d4OZoa27vGz4FG2EzzP+EOkvbFWfC1bD.G.txXs.k0MJa.MMDjaEPIKO1qCInOHlGPrlCQUXtAkVuJd+5dnj59UpnkT2m1Jt46M4siFMkfMuorGNH3JXfm45cqY8zMzpzNeBWPNEN60tSqt18Z5qKZ5zMJK2gAvcqMIVNNN5wLzDNUthDUbooPQXtzpC9Te3AeUmK6lUapnHmMhQEmNmvdnwgn7BpbvXNp.UEoiE+l7whYkODEl9UWMiXeTJjqtZBc9n9PmVgi.eBwYNIRPkofRexMvpqr4s0U6ShuVvmCY5xSQXazmLr1naWFx+57NKVR7wy6PXXnlHWmLlfix2fEiugLhMIh.8EYbPUBnZV.ajGvz98z38L0rd+GLbW1QdgPZJjjy.2GaYYshu+xOgu2uhuQuphuQGl66ePs23Q8dq9Ymp2+z+3jwm9l95xYXVCtX.5CTOg+Ra9yvN9D5L+xWE7wtcphlZOgST.OpJSAaWH+wem9zh+2pRXgM2KI.KVcKt7oK4BfN7UVWJWIxhohEUeZymkU6OU39b0ITgq+lw6Na.uPO8ma7l+PoFpClNk3JJAaM0gW74+UQn2wSDvFiiwvhCYivIIgNv6FcI.RXLRfbJjxNx4EYzskzxJiCg4kR7uvWtPaIsRtP6BgnPraD+R2roLxmh8rTN.lXouHst5wRZc6hgKppssZiBgqzW55JKE+Hf8May9agMubKr4fsvleZKr4m2Bad0VXyqeTajSSeShfGlcMAXLYP5PdEkAoiaS6HQ+WAR7Va
    


  • Works here. Are you on the latest version of Scriptnode?



  • @d-healey very recent, but will try latest. The API's are showing, but will try first thing



  • Also, what's going on with these braces?

        if(value==1)
            
        {
            Server.cleanFinishedDownloads();
    
            {
    

    Have you read this?



  • @d-healey latest scriptnode did the trick, thanks David (and yes I cleaned up my panicked placement of the braces 😆 )



  • @d-healey Soooo... Getting mixed results after compilation. On Windows it seems to be working and downloading the file correctly. On OSX I get nothing, and am wondering if Gatekeeper or something is stopping access to the web - ever come across something similar?


Log in to reply
 

12
Online

1.3k
Users

4.3k
Topics

38.6k
Posts