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

How can I upload a file to a Element #17

Closed
zjlx opened this issue Apr 29, 2020 · 3 comments
Closed

How can I upload a file to a Element #17

zjlx opened this issue Apr 29, 2020 · 3 comments
Labels
question Questions related to rod

Comments

@zjlx
Copy link

zjlx commented Apr 29, 2020

Content of your question.
I see the download example. How can I upload the file?

@zjlx zjlx added the question Questions related to rod label Apr 29, 2020
@ysmood
Copy link
Member

ysmood commented Apr 29, 2020

How about the example code in the unit tests?

https://github.com/ysmood/rod/blob/119b194d4268276e46349321d7b88a7d723b84df/element_test.go#L108

It's called SetFiles.

@ysmood
Copy link
Member

ysmood commented Apr 29, 2020

For example this website: https://www.dropzonejs.com/

You may code like this:

page.Element('[type=file]').SetFiles("a.jpg")

The upload should happen automatically.

@ysmood ysmood closed this as completed May 1, 2020
@zjlx
Copy link
Author

zjlx commented May 1, 2020

It is cool.
Thank you @ysmood .

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

No branches or pull requests

2 participants