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
When I'm out and about using mobile data, I find it hard to successfully upload photos and videos to Mastodon, because the uploads fail before they complete. I waste time and battery trying to upload again and again, only for the upload to drop each time — sometimes when it was almost finished!
Mastodon should have an API that allows resuming uploads. The current API does not allow this, requiring media to be uploaded all in one single request, which is difficult to achieve on even the best mobile connections when videos up to 99 MB are supported!
There is (surprisingly) no protocol-level standard on resumable uploads yet, but there is a standards-track draft called Resumable Uploads For HTTP, or RUFH. Alternatively, Mastodon could implement an ad-hoc API, which is what most makers of social/messaging apps seem to have done. Either way it would need the same basic parts as the standards draft has, something like:
POST /api/v3/media: reserve space for a media file to be uploaded and respond with a URL or ID (while possibly only uploading a small initial chunk of the file, or nothing),
HEAD /api/v3/media/:id: check how much of a media file has been successfully uploaded so far,
PATCH /api/v3/media/:id: upload an additional chunk of the media file, with a header or parameter giving the intended offset into the file (with a 409 Conflict given if that offset doesn't match the bytes uploaded so far).
and optionally DELETE /api/v3/media/:id to cancel a media upload. But Mastodon could cover this by just deleting orphaned media periodically. I guess it already does that if the media are not attached to a status.
Motivation
Being able to resume an upload will make it a lot easier for people to share photos and videos from events happening in the real world. Even I struggle with this living in a large North American city, so I can only imagine how crucial more reliable uploading of media may be for people in rural areas and in the Global South.
The text was updated successfully, but these errors were encountered:
Pitch
When I'm out and about using mobile data, I find it hard to successfully upload photos and videos to Mastodon, because the uploads fail before they complete. I waste time and battery trying to upload again and again, only for the upload to drop each time — sometimes when it was almost finished!
Mastodon should have an API that allows resuming uploads. The current API does not allow this, requiring media to be uploaded all in one single request, which is difficult to achieve on even the best mobile connections when videos up to 99 MB are supported!
There is (surprisingly) no protocol-level standard on resumable uploads yet, but there is a standards-track draft called Resumable Uploads For HTTP, or RUFH. Alternatively, Mastodon could implement an ad-hoc API, which is what most makers of social/messaging apps seem to have done. Either way it would need the same basic parts as the standards draft has, something like:
POST /api/v3/media
: reserve space for a media file to be uploaded and respond with a URL or ID (while possibly only uploading a small initial chunk of the file, or nothing),HEAD /api/v3/media/:id
: check how much of a media file has been successfully uploaded so far,PATCH /api/v3/media/:id
: upload an additional chunk of the media file, with a header or parameter giving the intended offset into the file (with a 409 Conflict given if that offset doesn't match the bytes uploaded so far).and optionally
DELETE /api/v3/media/:id
to cancel a media upload. But Mastodon could cover this by just deleting orphaned media periodically. I guess it already does that if the media are not attached to a status.Motivation
Being able to resume an upload will make it a lot easier for people to share photos and videos from events happening in the real world. Even I struggle with this living in a large North American city, so I can only imagine how crucial more reliable uploading of media may be for people in rural areas and in the Global South.
The text was updated successfully, but these errors were encountered: