-
Notifications
You must be signed in to change notification settings - Fork 9
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
Migrate to only use the upload endpoint, Add video parameter support #217
Comments
I agree that this would be a good addition to this library. I encourage you to create a pull request if you can. Regarding that bit of code, I have been through that several times and I know it is confusing but I think it is correct. I am willing to collaborate with you on this and see if that code can be changed. @Infinitay, |
Dissecting the code in question, from the Here is the definition of the payload object:
So, the for loop The only key that can meet the criteria of To add the Finally, I like the idea of removing a dependency and simplifying the code if it is at all possible. However, the formData we create in this library is both used as the imgur/src/image/updateImage.ts Line 34 in 2394300
That code is used in several other methods, and I am not sure that we can change it at this time. |
@Infinitay, I started this work in a branch here: I needs more work to be functional and then some documentation added, at the least. |
Is your feature request related to a problem? Please describe.
Unable to upload videos larger than 10MB
Describe the solution you'd like
When uploading an image or video, use the/image
endpoint/image
doesn't return useful info when trying to upload a video - the >10 MB videoimage
orvideo
parameter as the PayloadCurrently, users can't upload videos over 10 MB because regardless of the endpoint (
/image
or/upload
) theimage
payload parameter is limited to 10 MB while the newvideo
parameter has a limit of 200MB (https://apidocs.imgur.com/#c85c9dfc-7487-4de2-9ecd-66f727cf3139). By allowing users to specify whether they want to upload an image or video appropriately, not only would it be proper as opposed to sending a video as animage
payload, but it would also allow for larger video files to be uploaded.Additional context
Another thing, I was looking at the code and I wanted to let you know that axios can handle the form data on its own now by specifying the object as a payload. In our case, just make sure to maintain the form content header. For example,
I was going to try and make the changes myself, but I didn't want to potentially break anything since supposedly the tests aren't working. The main confusion was with
Specifically the checks to append the payload. I don't see how
form.append(key, payload);
is ever reached because isn'tif (supportedUploadObjectTypes.indexOf(key) !== -1)
never met? Checking the Payload type definition, the key could never be base64 or stream unless I am missing something else.Upvote & Fund
The text was updated successfully, but these errors were encountered: