claudiodangelis/qrcp

How to set path for windows?

g8up opened this issue · 3 comments

g8up commented

I'm opening this issue because:

  • I have found a bug

  • I want to request a feature

  • I have a question

  • Other

  • My Go version is: go version go1.11.2 windows/amd64

  • My GOPATH is set to: D:\go-path

I have set the config path as d:/myfile,but the file is still saved at C:\Users\Administrator

  • .qrpc.json
{
    "interface": "以太网",
    "port": 9999,
    "keepAlive": true,
    "path": "d:/myfile",
    "secure": false,
    "tls-key": "",
    "tls-cert": ""
}

Hello @g8up, this is interesting.
Did you try with D:\myfile (forward slash rather than backward's)?

g8up commented

Case 1

  • .qrcp.json
{
    "interface": "以太网",
    "port": 9999,
    "keepAlive": true,
    "path": "D:\myfile",
    "secure": false,
    "tls-key": "",
    "tls-cert": ""
}
  • echo
C:\Users\Administrator>qrcp receive
Error: invalid character 'm' in string escape code
Run `qrcp help` for help.

Case 2

  • .qrcp.json
{
    "interface": "以太网",
    "port": 9999,
    "keepAlive": true,
    "path": "D:\\myfile",
    "secure": false,
    "tls-key": "",
    "tls-cert": ""
}
  • echo in cmd
C:\Users\Administrator>qrcp receive
Scan the following URL with a QR reader to start the file transfer:
http://192.168.3.46:9999/receive/D:\myfile
(qrcode img)

I got a 404 page not found after scanning on mobile phone.

Hello, I believe there is some confusion here.
The "path" in the configuration file is not the path where the files are downloaded.
At this time you can only specify it by using the -o or --output flag, for example:

qrcp receive --output "D:"

or

cd D:
qrcp receive

If you don't specify the output directory, the current directory is chosen.
There is an open pull request about introducing a "default output" directory, but that's still a work in progress: #183
Hope this clears things up, thanks!
Claudio