-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[bug] Support for send 25Mb+ size files #766
Comments
I agree that we should support for sending 25Mb+ size files in Wechaty automatically, and your analysis looks very clear and will be useful. It would be very convenient for the user that we can just do the following operation without considering the file size:
To contrast, the user will have to write lots of code if we leave those jobs out of our Wechaty framework. |
Got it. I had already approved the PR, and so do @lijiarui. Could you please invite another reviewer to approve the PR, so we will meet the 3 approvements that I can merge it? Appreciate for that because that's the necessary step to keep the high quality of our code base. About the local temporary directory, I'd like to recommend to use the standard nodejs library function: See: https://nodejs.org/api/fs.html#fs_fs_mkdtemp_prefix_options_callback |
current progress: Current question: Hope solution:
Can I change uploadMedia () to public? |
Hi binsee, Great to hear that the forwarding and the large files all can be handled in your new code! I think it worth to change the Also please notice that: Have a nice weekend! |
Is it possible to fix a bug with file size is 0Kb when downloading 25mb+ files? |
@olifeolove Please tell me the details. |
@binsee I use bot receiving some files such as *.pdf or *.zip. The file will be saved as a 0 byte file when the file size is more than 25mb. |
@olifeolove If it is bot, please see #771 . |
@binsee Sorry, it's phone. I just use the bot to receive files. |
Please notice that when we are running Wechaty, if you use the browser that controlled by Wechaty to send attachment files, you will get a zero sized file, because it is not an attachment from the network, but a local data, which is not supported by Wechaty yet. |
@olifeolove Because webWx restrictions, more than 25 MB of files can not be downloaded. |
Landed at v0.8.240 |
Previously implemented to send any type of file, but there is a limit: send or forward more than 25Mb size file will fail.
The reason for the failure is that the server requires that the
Signature
field must be included when sending a file of size above 25Mb. This field is from the json data returned after the API_checkuploadwas called before the file was uploaded. The current
puppet-web` does not implement this.When the
ATTACH
type of message is received, theSignature
field is not included, so the server will fail when forwarding a file of size above 25Mb.The solution is as follows:
PuppetWeb.uploadMedia ()
, add a call toAPI_checkupload
PuppetWeb.uploadMedia ()
, add theSignature
fieldMediaMessage
, addreupload ()
, download the file and callPuppetWeb.uploadMedia ()
. Used to re-upload the file, the continuation of file validity.MediaMessage.forward ()
, when the file size is greater than 25Mb, callreupload ()
to re-upload the fileIf there are better suggestions, please comment.
Send details about 25Mb + size file messages:
Received data for file messages:
Post data for forward file:
forward failed
After uploading the 25Mb file, post data for send message:
Call the upload file API to get the data:
The text was updated successfully, but these errors were encountered: