You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation on UploadSrImgRequest is wrong, and the header field is redundant/obsolete. It should look like this:
exportinterfaceUploadSrImgRequest{/** file upload with maximum size of 500 KiB */file: string;/** one of png or jpg (default: png) */imgType: 'png'|'jpg';/** a valid subreddit image name */name: string;/* one of (img, header, icon, banner) */uploadType: 'img'|'header'|'icon'|'banner';/** the name of the subreddit */subreddit: string;}
I'm currently getting an error fetching the image to upload (HTTP request to domain: styles.redditmedia.com timed out with error: context deadline exceeded), but previously I've gotten a different error:
{
errors: [ 'IMAGE_ERROR' ],
imgSrc: '',
errorsValues: [ 'Invalid image or general image error' ]
}
I assume this is due to the encoding of the image data, but I'm not sure if it's because of my code, or because the upload code is writing the image data as a string instead of bytes (@devvit/protos/types/devvit/plugin/redditapi/subreddits/subreddits_msg.js line 1854). If it should be writing the data as bytes, then the file field in UploadSrImgRequest should have the type Uint8Array | string.
The documentation on
UploadSrImgRequest
is wrong, and theheader
field is redundant/obsolete. It should look like this:I'm currently getting an error fetching the image to upload (
HTTP request to domain: styles.redditmedia.com timed out with error: context deadline exceeded
), but previously I've gotten a different error:I assume this is due to the encoding of the image data, but I'm not sure if it's because of my code, or because the upload code is writing the image data as a string instead of bytes (
@devvit/protos/types/devvit/plugin/redditapi/subreddits/subreddits_msg.js
line 1854). If it should be writing the data as bytes, then thefile
field inUploadSrImgRequest
should have the typeUint8Array | string
.Test code:
The text was updated successfully, but these errors were encountered: