Vor
Vor

Reputation: 35129

Is it possible to download file to the server using JavaScript

Every time user click specific button, my javascript code needs to send request to the different server, and download a file to my server, than process it.

Is it possible to do?

Upvotes: 2

Views: 202

Answers (1)

username tbd
username tbd

Reputation: 9382

JavaScript by itself would not be able to do this, as it is a Client-side scripting language, meaning it runs entirely on the user's browser and has little to do with the server itself.

However, it would be entirely possible to do this with PHP (or any other server-side language), and then have JavaScript tell the server to run the PHP script to download and process the file.

Upvotes: 1

Related Questions