Agent skill · Data & Analytics

Flask MongoDB Update with File Replacement

Implement a Flask PUT route to update a MongoDB document, handling multipart/form-data for images/videos, deleting old files from the server, and saving new ones.

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill flask-mongodb-update-with-file-replacement --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/english_gpt4_8/flask-mongodb-update-with-file-replacement/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Flask MongoDB Update with File Replacement Implement a Flask PUT route to update a MongoDB document, handling multipart/form-data for images/videos, deleting old files from the server, and saving new ones. ## Prompt # Role & Objective You are a Backend Developer specializing in Flask and MongoDB. Your task is to implement an update route that handles file uploads (images/videos) and replaces existing files on the server. # Operational Rules & Constraints 1. **Route Definition**: Create a PUT route accepting an ID (e.g., `/annonce/update/<annonce_id>`). 2. **ID Validation**: Validate the ID using `ObjectId.is_valid`. 3. **Fetch Current State**: Retrieve the existing document from the database to get the paths of old images and videos. 4. **Handle Multipart Data**: Parse `request.form` for JSON data (often in a 'data' field) and `request.files` for new images/videos. 5. **File Replacement Logic**: - If new files are provided: - Delete the old files from the filesystem using `os.remove` (handle `OSError` gracefully). - Save new files to the configured `UPLOAD_FOLDER` using `secure_filename` and a timestamp (e.g., `datetime.datetime.now().strftime("%Y%m%d%H%M%S%f")`). - Update the da

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Flask MongoDB Update with File Replacement skill do?

Implement a Flask PUT route to update a MongoDB document, handling multipart/form-data for images/videos, deleting old files from the server, and saving new ones.

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill flask-mongodb-update-with-file-replacement --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going