Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每次用户单击特定按钮时,我的 javascript 代码都需要向不同的服务器发送请求,并将文件下载到我的服务器,然后进行处理。
有可能吗?
JavaScript 本身无法做到这一点,因为它是一种客户端脚本语言,这意味着它完全在用户的浏览器上运行,与服务器本身几乎没有关系。
但是,完全可以使用 PHP(或任何其他服务器端语言)执行此操作,然后让 JavaScript 告诉服务器运行 PHP 脚本以下载和处理文件。