Dynamic Web TWAIN示例代码中,文件扫描上传只提供了ASP.NET的实现。要在Linux中运行.NET Framework的代码须要用Mono。javascript
经过命令行查看下系统版本:html
$lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic
下载对应的Mono。java
安装XSP
:git
sudo apt install mono-xsp4
从GitHub上获取Dynamic Web TWAIN 示例源码:github
cd ~ git clone https://github.com/Dynamsoft/Dynamic-Web-TWAIN.git cd ~/Dynamic-Web-TWAIN/samples/Upload Download/Visual Studio Demo
申请30天试用的证书。ubuntu
打开UploadWithHTTP.html
修改JS代码:浏览器
<script type="text/javascript"> Dynamsoft.WebTwainEnv.ProductKey = 'Your Trial License'; var console = window['console'] ? window['console'] : { 'log': function () { } };
下载资源包解压到工程目录中:ionic
- Resources - SaveToFile.aspx - UploadWithHTTP.html
运行工程:命令行
xsp4 --port 9000
安装SANE:code
sudo apt-get install sane
在浏览器中打开http://localhost:9000/UploadWithHTTP.html
。若是没有安装Dynamic Web TWAIN服务能够点击安装。
接下来就能够在浏览器中扫描上传文件了: