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

Can the webui_set_file_handler serve the image files or other type? #355

Closed
heimo88 opened this issue May 6, 2024 · 3 comments
Closed

Comments

@heimo88
Copy link

heimo88 commented May 6, 2024

I found that the webui_set_file_handler only return the strings, can I return a byte[] or stream for the images or other file like mp3 mp4 etc. ?

@heimo88
Copy link
Author

heimo88 commented May 6, 2024

By the way, your project is excellent. tks!

@AlbertShown
Copy link
Contributor

Yes, if you are using C/C++ webui_set_file_handler is const void *, which mean you can return any raw binary data, just be sure to set the size of your binary data.

If you are using a wrapper (Other than C/C++) then you should re-open issue in the wrapper's repo to make sure the wrapper also support binary.

@heimo88
Copy link
Author

heimo88 commented May 20, 2024

Great, you're right. I'm using Lazarus, and in its wrapper, it uses Pansichar. I changed it to Pointer, and it worked. Thanks again.

@heimo88 heimo88 closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants