I am developing a node-webkit application. I would like to download a .swf file when I clicked a button and automatically save it to a specific directory. Right now, I can download it but a "save as" dialog is prompting. Is it possible to disable it and just automatically save it? Is this possible with javascript?
2
There are 2 best solutions below
1
smendou
On
Node Webkit Apps are not Website, therefore yes, you can do so by using a node module. For example, using fs (File system) :
var fs = require("fs");
fs.writeFile("myfile.txt", "Yes! with nwjs i can do stuff that i'm not allowed to do in browser!", function(err) {
if(err)console.log(err)
else console.log("file saved");
});
Maybe you can read the content of your downloaded file and pipe it to where you want :
fs.createReadStream(source_file_path).pipe(fs.createWriteStream(dest_file_path))
You are not restricted as in the browser.
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in FLASH
- Failing write/read on RH850 with NOR flash
- Unique ID to transfer guest account data from Adobe AIR to Unity
- flashplayer_32_sa: SecurityError: Error #2028: Local-with-filesystem SWF file
- what is the simplest way and what applications to use in making an exe file that runs .swf file assetss
- Does a physical filesystem works only for a specific type of storage media?
- when I try to enable flash encryption in esp32, the bootloader size is large . But I'm unable to find bootloader field in partition table
- Manage FIFO implemented in a non-volatile flash NOR memory
- create a quiz with actionscript 3
- How to connect two x16 nor flash to nor flash controller?
- Looping in Adobe Flash Professional CS6
- AOSP flahed to android emulator
- How do I compile Flash app files with mxml and as extensions?
- Winbond W25Q01 (1G-BIT) Flash erases 256-bytes not 4K and fails write-read-verify after address 0x07000000
- On Pixel 7a Android AOSP
- Defer implementation of interface functions to child class
Related Questions in NODE-WEBKIT
- NWJS(Node-Webkit): How to get the default printer?
- Stop NW.js from trying to connect to the internet
- How to open NW.js exe app and test it? is it really possible to automate and access the web elements? I wrote a script in JavaScript
- NW.js:Clicking on a link to an open website does not trigger the 'new-win-policy' event
- How to open nwjs app in sdk version to debug?
- nw.js: Simply Create a Windows Shortcut to open a folder/package.json with NW.JS
- nwjs crash Cloud management controller initialization aborted as CBCM is not enabled
- pgAdmin4: An error message appears before app successfully loads and opens in Windows 10, what to do?
- How can I share nw.js binaries with apps in subfolders?
- NW.js stuck in loading state after submitting form in Express.js
- How to use require or import and not balise html
- What exactly does "Neutralinojs" do to be so much smaller than Electron and NW.js?
- nw.js - Implementing an auto-updater in your app?
- nw.js - Spawn child_process using nw.js' built-in Node?
- How to do indexOf √ (sqrt character)
Related Questions in SWFUPLOAD
- Content upload progress using ajax
- SWFUpload + Django 1.2 CSRF problem
- How does SWFUpload work?
- Swfupload suddenly stopped working in IE (with flash 10 and windows 7)
- what code should be in upload.php for jquery swfupload?
- What is the Rails equivalent to PHP's echo("ok")?
- SWFUpload and Uploadify upload file very fast but error in certain computer
- How to cancel SWFUpload dialog open?
- ASP.Net session state not available on another webpage
- SWFUpload parameters not being posted
- Why SWFUpload does not start uploading?
- how to pass js variable as key into options array
- swfupload: how to parse returned data from upload.php script?
- swfupload ie9 error
- SWFUpload and SSL Client Certificate upload
Related Questions in NW.JS
- User navigating to site in game client gets HTML response from an unknown site
- How can I add a loading gif while my nw.js application reads a csv file?
- nw.js chromedriver won't run from outside of the project folder
- How to use npm package in nw.js without installing Node JS
- AngularJS alert strange behavior
- How to open new window on production build NW-React?
- Change the language locale for chrome.app?
- NW.js - check if confirm window has focus
- NW.js How to debug when your main file is an JS file?
- NW.js fullscreen mode is actually borderless windowed, not true fullscreen
- How to change JSON save location/directory in NW.js
- NW.js + PDF.js: How to provide an URL to pdf.js?
- "Script error" on IndexedDB with window.onerror()
- In Windows Node.js fs.readdirSync With Users Folders etc
- NWJS (Node Webkit) app is not responding on Linux systems when I use it with Web Workers
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
No. Otherwise malicious websites would be able to overwrite important files on your computer