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

Allow upload of local files. #112

Open
WhileLoop opened this issue May 19, 2017 · 9 comments
Open

Allow upload of local files. #112

WhileLoop opened this issue May 19, 2017 · 9 comments

Comments

@WhileLoop
Copy link

Is this possible? Didn't see anything in the readme about it.

@zachfeldman
Copy link
Contributor

Yeah I think you could make a YAML file that just points to files on your local machine, have you tried that?

@WhileLoop
Copy link
Author

Tried it. Maybe I got the syntax wrong?

Uploading aws with ./aws.png
(node:23728) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Invalid URI "./aws.png"

Uploading aws with file://./aws.png
(node:23777) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: Invalid protocol: file:

@zachfeldman
Copy link
Contributor

Have you tried an absolute path instead of a relative one?

@WhileLoop
Copy link
Author

Absolute path didn't work either.

@zachfeldman
Copy link
Contributor

@WhileLoop Got it. I took a deeper dive into the upload method and realized it loads emojis using the request() lib:
https://github.com/lambtron/emojipacks/blob/master/lib/slack.js#L188

In order to load local files, you'd have to integrate a local file reader. Here's a a similar thread:
http://stackoverflow.com/questions/30851520/get-local-json-file-using-request-promise

Alternately, you could upload them somewhere temporary and take them down when you're done - you don't need to commit the .yaml file to the repo to use it!

@kinduff
Copy link

kinduff commented Jun 26, 2017

👍

@EaterOA
Copy link

EaterOA commented Oct 31, 2017

You can also run a local http server (e.g. python3 -m http.server). Then you can use localhost urls.

@kinduff
Copy link

kinduff commented Nov 1, 2017

Nice workaround @EaterOA

@moustachedelait
Copy link

Any recommendations on how to generate a YAML file of a local directory of images?

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

5 participants