-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Add support for uploading files from memory + bug fixes #168
base: develop
Are you sure you want to change the base?
Conversation
|
Can you separate the bug fixes into different pull request? |
Hello, are you there, I would be happy to accept bug fixes. However I want to consider the new feature separately. |
Not got around to it yet. It'll try to sort it out soon. |
I've added a number of you bug fixes, please fix the merge conflicts |
@yourWaifu the only merge conflict is the version of CPR I use (since I had to use a custom one to fix an upload bug), they recently merged a fix for that, but it looks like the version you use is still before that. I'll try switching the new official version soon & make sure that works (this branch is kind of changes for my bot -- not a super neat PR). It currently has these changes:
|
I can't merge when there are merge conflicts, maybe try doing a git rebase. |
@yourWaifu I fixed it for you. I'm leaving the CPR version as you had it as I've yet to try the new version & don't want to link to my fork here. Though I suggest you look into updating it soon. |
I have updated cpr, I took a look at supporting buffer uploads but I found a problem. You Discord expects a filename if you want to attach it to an embed. CPR doesn't look like it has a way to set the filename of a buffer that I know of. |
oops nevermind my last statement about buffers and filenames, I didn't look at the libcurl docs hard enough |
You don't have to do it in libcurl, |
(the constructor of cpr::Buffer changed a bit since this PR, the name now has to be a std::string like: |
This PR allows for uploading files directly from memory (a feature I needed).
Note!
This PR changes the cpr repo to https://github.com/MacDue/cpr !
This is due to a bug with cpr where uploading files larger than 16,000bytes would corrupt the file -- which I repaired in my fork. Issue described here: libcpr/cpr#342