这个问题很奇怪,但这是因为我什至对这个概念一无所知。
事情是这样的:
我正在使用一个 Electron 应用程序,它是一个白板应用程序。
用户可以在板上绘制一些东西并将其导出为 PDF。
此 PDF 将保存到一个文件夹中(我假设 Windows 上的 AppData 文件夹或 MacOS 上的类似文件夹),以便其他机器可以访问(下载)它。
现在不知道怎么让其他机器下载这个文件。
通常我们需要共享文件夹(在 Windows 上),其他机器可以到 Networks/our-machine 找到并下载共享文件。
但是这个应用程序的所有者说,如果两台机器在同一个局域网上,我们可以下载它,使用某种 URL,如 192.168.x.x:6554/mypdfile_somerandomid.pdf
(此网址可转为二维码,方便移动设备使用摄像头快速访问链接)
我不知道这怎么可能。你能建议一些解决方案吗?
非常感谢你
最佳答案
A URL, or uniform resource locator, is a form of address that refers to a location or file on a network. The address is formatted like this:
scheme://servername.example.com/folder
The scheme specifies the protocol or type of server. The example.com portion of the address is called the domain name. If a username is required, it is inserted before the server name:
scheme://username@servername.example.com/folder
Some schemes require the port number to be specified. Insert it after the domain name:
scheme://servername.example.com:port/folder
如果没有 windows 提供的公共(public)共享,您将需要其他第三方软件来完成您想要的,这将与 windows 一样。
最好只共享您的 Electron 应用程序用于导出 PDF 的文件夹。
关于electron - 如何允许同一局域网中的其他机器(PC/Mac/移动设备)从我们的 Electron 应用程序下载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48003591/