class FileUploadTagger
- FileUploadTagger
- Tagger
- Reference
- Object
Defined in:
tagger/taggers/file_upload.crConstant Summary
-
MEDIA_UPLOAD_PARAM_TYPES =
Set {"file", "form"} -
Form-style carriage: a genuine browser file upload arrives as a
fileparam or a multipartformfield. JSON/body media fields are almost always a URL/reference string. -
MEDIA_WORDS =
Set {"image", "images", "photo", "photos", "avatar", "media"} -
Media words that frequently name a reference — a profile-image URL, an avatar link — inside a JSON/body payload rather than an uploaded file. Treated as an upload only when carried as multipart form data (a
file/formparam) or corroborated by an upload-ish URL, so a JSON{"image": "https://..."}field (e.g. RealWorld'sPUT /user) is not mis-tagged as a file upload. -
SEGMENT_ONLY_PATH_PARTS =
Set {"media"} -
mediais matched only as a whole/mediapath segment, never as a loose sub-token. As a loose token (split on-/_) it fired on config/feature routes that merely contain the word but upload nothing:/settings/media-path(a media-directory setting, e.g. koel),/social-media,/media-library. A standalone/mediacollection (POST /media) still tags. -
UPLOAD_METHODS =
Set {"POST", "PUT", "PATCH"} -
UPLOAD_PARAM_TYPES =
Set {"file", "form", "body", "json"} -
UPLOAD_PATH_PARTS =
Set {"upload", "uploads", "attach", "attachment", "attachments", "import", "imports", "avatar", "photo", "photos", "file", "files", "image", "images", "picture", "pictures"} -
WORDS =
Set {"file", "files", "upload", "attachment", "attachments", "document", "documents", "multipart", "content_type", "filename", "content_disposition"} -
Param names that denote an actual uploaded file regardless of how the value is carried — a
filename, anattachment, amultipartboundary. Safe to flag on any writable param type.