How Vehicle Photos, Videos, and Attachments Work
Source: `vehicles_controller.rb`, `vehicle_attachments_controller.rb`
- Photo upload accepts images, PDFs, and videos; images and PDFs must be under 4MB; video uploads require the company to have available minutes balance
- Image uploads automatically generate a 100px thumbnail; the S3 storage bucket differs between production and staging environments
- Video uploads deduct from the company's minutes balance; when the balance hits zero, an auto-purchase is triggered if the company has auto-purchase enabled
- Batch attachment updates are wrapped in a database transaction: either all updates succeed or none do (all-or-nothing)
- The "advertise all" function excludes PDF attachments; up to 7 advertising platforms are supported for image distribution
- Mobile attachment listings exclude PDF files, showing only images and videos
Support scenarios
- "Photo upload failed with a size error" → Images and PDFs must be under 4MB. Ask the customer to reduce the file size or resolution before uploading.
- "Video upload failed" → Video uploads require the company to have minutes balance. Check if the balance is zero and whether auto-purchase is enabled. If auto-purchase is off and balance is zero, minutes need to be purchased manually.
- "Some attachments didn't update in a batch" → Batch updates are transactional. If any single attachment in the batch fails, the entire batch is rolled back. Check for the specific attachment causing the failure.
- "PDFs aren't showing on mobile" → Mobile attachment listings exclude PDFs by design. PDFs are only visible on the desktop version.
- "PDFs aren't being advertised" → The advertise-all function deliberately excludes PDFs. Only image attachments are distributed to advertising platforms.