Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to upload file #58

Closed
link2xt opened this issue Apr 4, 2018 · 8 comments
Closed

Add an option to upload file #58

link2xt opened this issue Apr 4, 2018 · 8 comments

Comments

@link2xt
Copy link

link2xt commented Apr 4, 2018

If no filename is provided, generate a link to upload form instead, so it is possible to upload a file from phone to the server.

@claudiodangelis
Copy link
Owner

claudiodangelis commented Apr 4, 2018

Hi @labdsf, thanks for the suggestion, someone is already working at this, please follow this thread: Add upload capability #8

@brualan
Copy link
Contributor

brualan commented Aug 6, 2018

I saw PR #8, but the code suggested there does not seem to me good enough. And it's been a while, so there may be problems with the merger.
I would like to have this feature. It seems to me that the best option is to add the "-upload" flag. If the user specified the folder in which the files will be loaded into the arguments, then load it there, otherwise save the received files to "Downloads/qr-filetransfer" or "qr-filetransfer" in the home folder.
Any thoughts?

@claudiodangelis
Copy link
Owner

I agree that #8 might require some refactoring.

The way I see it:

  1. we should name it -receive flag rather than -upload

    it seems more natural to me to run in my terminal

    qr-filetransfer -receive -to /path/to/my/download

    rather than

    qr-filetransfer -upload

    However, I still find it very verbose, maybe we can find a different solution

  2. we should add a -to (or -out or -dest or whatever) flag

    In my experience I've never seen a command line program using a default download directory (counter examples are welcome) and, personally, I wouldn't like that too much. I want it to be immediately clear to the user where the received files will be stored

  3. as per current PR (Add upload capability #8), the destination argument is the file about to be transfered, I think it should be a directory instead

@brualan
Copy link
Contributor

brualan commented Aug 7, 2018

I agree that the -receive flag looks much clearer than -upload. But pointing the folder via the flag seems too complicated.
I see it like that: if the user did not specify a directory, then the program should output something like

Please specify the directory where the received files will be placed

and finishes the execution.

@claudiodangelis
Copy link
Owner

I'm CC'ing @twooster and @barryz, author and reviewer of #8, into this thread.

@brualan
Copy link
Contributor

brualan commented Aug 8, 2018

I made some progress. Some work still needs to be done, but you can already enjoy it. Criticism and suggestions are welcome.
https://github.com/brualan/qr-filetransfer

@claudiodangelis
Copy link
Owner

@brualan thanks for staying on this. Please open a PR so we can review from here.

@claudiodangelis
Copy link
Owner

The feature has been implemented!

Pass the -receive flag and the path to a directory:

qr-filetransfer -receive ~/Downloads

By scanning the QR you will be prompted with an upload page on your mobile:

image

And files will be transfered to ~Downloads. Thanks again to @brualan and @twooster for working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants