Skip to content

Enable Direct Profile Picture Uploads on Open Library #13263

Description

@Sadashii

Problem / Opportunity

  • Problem: Currently, Open Library users cannot upload or change their profile picture (avatar) directly on the platform. The avatar URL is generated via https://archive.org/services/img/{itemname} (where itemname is the user's Internet Archive item ID, typically @username). To update their profile picture, users have to leave Open Library, navigate to Archive.org, log in there, locate their account item page, and upload their image there.
  • Justify: This multi-step, multi-site journey is extremely counter-intuitive. Users expect to edit all their profile details in one place. As a direct result, Lisa and the helpdesk support team receive a steady, high volume of support inquiries from users asking how to update their profile picture or reporting it as broken/missing.
  • Success Criteria: Users should be able to upload, update, and delete their profile picture directly from the edit profile page on Open Library. The new profile picture should show up immediately across the site (without waiting for the 24-hour cache expiry).

Proposal

  • Add an image file input (with format/size validation) to the profile edit form.
  • Create a FastAPI endpoint (e.g. POST /account/avatar) to receive the uploaded image.
  • Use the logged-in patron's decrypted s3_keys (via get_s3_keys(account)) to upload the image directly to their Internet Archive account item (typically @username) using the internetarchive Python SDK or S3 API.
  • Invalidate the User.get_avatar_url cache upon a successful upload so the change is immediately visible.

Breakdown

Implementation Details (for maintainers)

Related files

Refer to this map of common Endpoints:

Requirements Checklist

  • Add an image file input (with format/size validation) on the profile edit form.
  • Implement a FastAPI endpoint (e.g. POST /account/avatar) to receive the uploaded image.
  • Use get_s3_keys to authenticate and upload the photo to the user's Internet Archive item (@username) using the internetarchive Python SDK or S3 API.
  • Invalidate the User.get_avatar_url cache upon a successful upload.
  • Update documentation to guide users on the new upload feature, and update any helpdesk guides.

Stakeholders

  • @seabelis (Community Manager & Support Lead) - Primary contact for user feedback and support coordination.
  • Backend Leads / Security team - To review S3 upload policies, rate limits, and allowed image formats.

Instructions for Contributors

Metadata

Metadata

Assignees

Labels

Lead: @RayBBIssues overseen by Ray (Onboarding & Documentation Lead) [manages]Priority: 3Issues that we can consider at our leisure. [managed]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions