electron - 如何允许同一局域网中的其他机器(PC/Mac/移动设备)从我们的 Electron 应用程序下载?

标签 electron lan

这个问题很奇怪,但这是因为我什至对这个概念一无所知。

事情是这样的:
我正在使用一个 Electron 应用程序,它是一个白板应用程序。

用户可以在板上绘制一些东西并将其导出为 PDF。

此 PDF 将保存到一个文件夹中(我假设 Windows 上的 AppData 文件夹或 MacOS 上的类似文件夹),以便其他机器可以访问(下载)它。

现在不知道怎么让其他机器下载这个文件。

通常我们需要共享文件夹(在 Windows 上),其他机器可以到 Networks/our-machine 找到并下载共享文件。

但是这个应用程序的所有者说,如果两台机器在同一个局域网上,我们可以下载它,使用某种 URL,如 192.168.x.x:6554/mypdfile_somerandomid.pdf

(此网址可转为二维码,方便移动设备使用摄像头快速访问链接)

我不知道这怎么可能。你能建议一些解决方案吗?

非常感谢你

最佳答案

Writing URLs

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/

相关文章:

javascript - contextIsolation 的默认值已弃用,并将在 Electron 的 future 版本中从 false 更改为 true

android - 有没有办法使用 Android 中的 DownloadManager 通过 LAN 下载?

linux - 为什么我无法使用静态 ip ping 到任何地址?

从本地网络(WinSock,C)与公共(public) IP 通信

javascript - 使用 Electron 配置 Webpack 以使用 ES6 导入?

javascript - 在 Electron 应用程序中将文件从 blob 写入磁盘

ubuntu - ipmessenger 在 ubuntu 14.04 中不工作

java - 如何获取局域网中的 IP 地址列表?

node.js - 如何创建针对 Electron 平台的 cordova 插件?

vue.js - vue-i18n 与 vue- Electron : TypeError: Cannot read property '_t' of undefined