-
Notifications
You must be signed in to change notification settings - Fork 26
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
Multiform requests not working #28
Comments
With that, you will have the problem when sending files as IDs instead of the file from your system (which you can do in telegram) You can send a file from your file system with
|
I get an error with this API. 🤔 Somthing isn't matching ** (FunctionClauseError) no function clause matching in :filename.do_flatten/2
The following arguments were given to :filename.do_flatten/2:
# 1
{:file, "/tmp/temp.jpg"}
# 2
[]
(stdlib) filename.erl:992: :filename.do_flatten/2
(stdlib) filename.erl:190: :filename.basename/1
(maxwell) lib/maxwell/multipart.ex:291: Maxwell.Multipart.mp_file_header/2
(maxwell) lib/maxwell/multipart.ex:176: anonymous fn/3 in Maxwell.Multipart.len_mp_stream/2
(elixir) lib/enum.ex:1948: Enum."-reduce/3-lists^foldl/2-0-"/3
(maxwell) lib/maxwell/multipart.ex:167: Maxwell.Multipart.len_mp_stream/2
(maxwell) lib/maxwell/adapter/util.ex:98: Maxwell.Adapter.Util.multipart_encode/2
(maxwell) lib/maxwell/adapter/adapter.ex:75: Maxwell.Adapter.Hackney.send_multipart/1 |
@alan-andrade Is this how you are doing? ExGram.send_photo(chat_id, {:file, "files/images/welcome.png"}) |
@alan-andrade remember to revert the changes that you made 😄 With your changes, all the files were wrapped inside a Basically, if you want to send a file from your system, you use |
I'm trying to upload a photo from a bot.
Code looks like:
I receive the following error:
After some debugging, I realized the request isn't being multiformed properly.
I also saw this might be a known issue since some type validations have a"#TODO" note.
For quickfix I was able to work around it by modifying
macros.ex
~LOC 382.Notice the vn2.
I'm just beginning with Elixir and I haven't figured out the best approach for this fix. Any ideas?
The text was updated successfully, but these errors were encountered: