"The file "command.cgi" couldn’t be opened."



Flashair W-04第四代SD存储卡

在我的iOS应用程序目录中列表API不起作用。

响应:

任务。< 0> http负载失败(错误代码:-1003 [12:8](

2019-05-21 23:32:40.267572 0530 razzo [10489:87069] nsurlconnection结束了错误-Code -1003

错误域= nScocoaErrordomain代码= 256" file" command.cgi"无法打开。userInfo = {nsurl = http://flashair/command.cgi?op = 100& dir =/dcim}

请帮助我有什么问题

下面代码段

private func getdata() {
        let url100 = URL(string: "http://flashair/command.cgi?op=100&DIR=/DCIM")
        var dirStr: String? = nil
        do {
            if let url100 = url100 {
                dirStr = try String(contentsOf: url100, encoding: String.Encoding(rawValue: String.Encoding.utf8.rawValue))
                if let dir = dirStr {
                    arrayfiles = dir.components(separatedBy: "n")
                }
                tblContent.reloadData()
            }
        } catch {
            print(error)
            self.displayAlert(message: error.localizedDescription)
        }
}

配置文件下面

[供应商]

cipath =/dcim/100__tsb/fa000001.jpg

appmode = 4

appnetworkkey = 12345678

版本= F15DBW3BW4.00.03

CID = 02544D535733324755E3C6DC7B012301

product = flashair

供应商=东芝

MasterCode = F437B71E0E4F

lock = 1

contentsOf: url100将用于本地文件URL。您没有提供有效的文件URL。

如果您的文件是远程,则需要使用URLSESSION将文件作为数据下载。如果是本地,则需要计算出其文件URL。

相关内容

最新更新