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

[Feature] Read in from stdin/pipe #413

Open
corneliusroemer opened this issue Sep 29, 2021 · 4 comments · May be fixed by dutchcoders/transfer.sh-web#45
Open

[Feature] Read in from stdin/pipe #413

corneliusroemer opened this issue Sep 29, 2021 · 4 comments · May be fixed by dutchcoders/transfer.sh-web#45

Comments

@corneliusroemer
Copy link

I'm using the transfer.sh script linked on the website. Would it be possible to extend this script so that I can pipe input into it, rather than having to specify an existing file?

transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;}
@aspacca
Copy link
Collaborator

aspacca commented Sep 29, 2021

@corneliusroemer
it's feasible but we still would need a filename for the upload

it could be generated randomly as well, what's your proposed solution for this?

@corneliusroemer
Copy link
Author

Random name is perfectly fine in this case, what else should it be :) could of course be passed as a command line argument as extra feature as add on.

@anihm136
Copy link
Contributor

Hi! I've modified the script from the website to accept input from STDIN. Where would you like me to share it? I noticed that there is a separate repository for the web frontend, where the script is currently located

@aspacca
Copy link
Collaborator

aspacca commented Oct 16, 2021

@anihm136 you probably want to send a PR for changing https://github.com/dutchcoders/transfer.sh-web/blob/master/src/index.html#L165

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

Successfully merging a pull request may close this issue.

3 participants