4

Download file and JavaScript calling

Hello everyone,

Recently, I responded to a request from someone who wanted to be able to download a file without encountering a blank window. This required the use of JavaScript, and the person did not want to install Ninext for this. Therefore, I proposed an alternative solution that allows calling JavaScript using a dialogue window. The system is simple: it is possible to insert HTML into a dialogue window, which therefore allows the addition of JavaScript as well. You just need to add the necessary code for downloading a file to enable the download, and a small piece of code that closes the window after the code has been executed. This is what the global functions downloadURL() and execJS() do in the attached application.

It would also have been possible to add the code in an HTML form that mimics a Ninox button, but I find this solution more cumbersome compared to a global function that can be called from any code (provided, of course, that it is executed locally).

 Enjoy 🤗

#Download file.ninox 

4 replies

null
    • John_Halls
    • 4 days ago
    • Reported - view

     This is EXACTLY what I was looking for. Thank you!

    • John_Halls
    • 2 days ago
    • Reported - view

     Hi Jacques. I use a label printing program called BarTender used extensively in production environments ( will know about this). I am using your program to store the many hundreds of different files we have so that we can easily find and download the correct one. They all have a btw extension. Is there a way to adapt your button to be able to download the file and then run it? Not a problem , if not.

    We used to have all these files in a complex file and folder structure that no-one fully understood. This simple one-table app is saving us hours a week!

    Many thanks

    John

      • Ninox developper
      • Jacques_TUR
      • yesterday
      • Reported - view

       It seems possible to launch an application from JavaScript, but you need to configure the operating system the application runs on, and perhaps even create a local application for that. I don’t fully understand your requirements, but it seems to me that the simplest approach would be to use BarTender’s REST API to send your files to it and request print jobs, without having to install any application on users’ machines.

      • John_Halls
      • yesterday
      • Reported - view

       Thanks Jacques. I'll look into BarTender's REST API.

Content aside

  • 4 Likes
  • yesterdayLast active
  • 4Replies
  • 313Views
  • 3 Following