Replacing File Contents Without Breaking Links in Tsugi @ChuckSeverance
Replacing File Contents Without Breaking Links in Tsugi  @ChuckSeverance
Uploaded October 2026 | Updated November 2026, 1 day ago
In this episode, I add a file-replacement feature to Tsugi.

The goal sounds simple:

replace the contents of an existing uploaded file without changing the logical file that the rest of the course points to.

That means pages, lessons, exports, imports, and copied links should all continue to work even though the underlying file bytes have changed.

Canvas has a version of this during upload: if a file with the same name already exists, Canvas can replace it, rename it, or skip it.

I wanted something more explicit.

In Tsugi, the instructor can open an existing file and choose “Replace Content” directly.

The tricky part is the storage model.

Tsugi uses a single-instance, content-addressed blob store keyed by SHA-256.

So replacing a file must not overwrite a shared blob.

Instead, the logical file record stays stable while it is repointed to a new content digest. If some other course is still using the old blob, that old blob remains untouched.

I also tighten up link behavior so copied file URLs use stable course paths instead of SHA-256 URLs. That way, if an instructor has pasted a file link into a page, replacing the underlying file does not make that link stale.

Then comes validation.

I do not want somebody replacing a PNG with an arbitrary ZIP file while keeping the original filename and content type.

So the replacement flow checks the uploaded file’s actual type and rejects incompatible substitutions.

The end result is exactly what I wanted:

open a file → replace its contents → keep the same logical identity → keep all the existing links working.

By the final smoke test, I can swap one JPEG for another and then swap the original back in with essentially no disruption to the surrounding course content.

This is one of those small LMS features that instructors may not use every day, but when they need it, it is enormously useful.
Replacing File Contents Without Breaking Links in TsugiCan You Build Software with AI in 30 Hours? (Vibe Coding #1)Making Open Badges Self-Contained: Denormalization and Air-Gapped CredentialsHow to Winterize a Sea-Doo Speedster (2006) | Drill Pump & RV Antifreeze MethodShelby visits Mari Winery and shares a Charcuterie tray #aussie #dogcation #spoiledpup2AM Bathrobe Coding With AI — Building Page History - Master ProgrammerAI Coding: Tsugi Accessibility Fixes with Wave and Cursor.AIBuilding LTI 1.3 Names and Roles with AI – A 4 AM Silent Coding SessionAfter the Experiment: What Actually Worked (Vibe Coding #4)Shelby at TraverseCityHorseShows at getting impatient #dogcation #horsejumping #aussie #spoiledpupTwas the night before Christmas - Playing catch with an Aussie #dog #aussie #snowDJ 29.05 JavaScript Network Events with Fetch and Promises (6:26)
Chuck Severance |

Replacing File Contents Without Breaking Links in Tsugi

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER