{"id":14449141,"url":"https://github.com/kid1194/frappe-better-attach-control","last_synced_at":"2025-08-28T03:31:28.014Z","repository":{"id":55408834,"uuid":"523053676","full_name":"kid1194/frappe-better-attach-control","owner":"kid1194","description":"A small plugin for Frappe that adds the support of customizations to the attach control.","archived":false,"fork":false,"pushed_at":"2024-05-02T19:05:29.000Z","size":634,"stargazers_count":38,"open_issues_count":5,"forks_count":36,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-15T18:13:53.063Z","etag":null,"topics":["attachment","erpnext","erpnext-customization","file-upload","frappe","frappe-attachments","frappe-framework","javascript","uploads"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kid1194.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-09T17:49:58.000Z","updated_at":"2024-06-13T00:40:12.181Z","dependencies_parsed_at":"2024-01-17T19:35:06.120Z","dependency_job_id":"f920568c-f819-46e7-bf3e-87a62d1a53dd","html_url":"https://github.com/kid1194/frappe-better-attach-control","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/kid1194/frappe-better-attach-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kid1194%2Ffrappe-better-attach-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kid1194%2Ffrappe-better-attach-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kid1194%2Ffrappe-better-attach-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kid1194%2Ffrappe-better-attach-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kid1194","download_url":"https://codeload.github.com/kid1194/frappe-better-attach-control/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kid1194%2Ffrappe-better-attach-control/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272430540,"owners_count":24933886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attachment","erpnext","erpnext-customization","file-upload","frappe","frappe-attachments","frappe-framework","javascript","uploads"],"created_at":"2024-09-01T08:01:08.878Z","updated_at":"2025-08-28T03:31:27.644Z","avatar_url":"https://github.com/kid1194.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Frappe Better Attach Control\n\nA small plugin for Frappe that adds customization to the attach control.\nIt supports RTL layout and dark mode out of the box.\n\n⚠️ **v2 is still in BETA stage** ⚠️\n\n![v2 Beta17](https://img.shields.io/badge/v2_Beta17-2024/06/13-green?style=plastic)\n\n**Apologies in advance for any problem or bug you face with this module.**\n**Please report any problem or bug you face so it can be fixed.**\n\n---\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/kid1194/frappe-better-attach-control/blob/main/images/screenshot_1.png?raw=true\" alt=\"Better Attach Control\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/kid1194/frappe-better-attach-control/blob/main/images/screenshot_2.png?raw=true\" alt=\"Better Attach Control\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/kid1194/frappe-better-attach-control/blob/main/images/screenshot_3.png?raw=true\" alt=\"Better Attach Control\"/\u003e\n\u003c/p\u003e\n\n---\n\n### Status\n- **Desk**: 🔵 Testing\n- **Web Form**: 🔵 Testing\n\n---\n\n### Special Thanks \n**A simple display of gratitude and appreciation to those who provided helped and kind support.**\n#### Version 2\n- [![MohsinAli](https://img.shields.io/badge/MohsinAli-Debug_%7C_Test_%7C_Fix-ff0000?style=plastic)](https://github.com/mohsinalimat)\n- [![Robert C](https://img.shields.io/badge/Robert_C-Debug_%7C_Test-orange?style=plastic)](https://github.com/robert1112)\n- [![NirajRegmi](https://img.shields.io/badge/NirajRegmi-Debug_%7C_Test-orange?style=plastic)](https://github.com/NirajRegmi)\n- [![galaxlabs](https://img.shields.io/badge/galaxlabs-Enhancement-blue?style=plastic)](https://github.com/galaxlabs)\n#### Version 1\n- [![CA. B.C.Chechani](https://img.shields.io/badge/CA._B.C.Chechani-Debug_%7C_Test-blue?style=plastic)](https://github.com/chechani)\n\n---\n\n### Table of Contents\n- [Requirements](#requirements)\n- [Setup](#setup)\n  - [Install](#install)\n  - [Update](#update)\n  - [Uninstall](#uninstall)\n- [Usage](#usage)\n- [Available Field Options](#available-field-options)\n- [Available JavaScript Methods](#available-javascript-methods)\n- [Supported Fields](#supported-fields)\n- [Issues](#issues)\n- [License](#license)\n\n---\n\n### Requirements\n- Frappe \u003e= v12.0.0\n\n---\n\n### Setup\n\n⚠️ **Do not forget to replace [sitename] with the name of your site in all commands.** ⚠️\n\n#### Install\n1. Go to bench directory\n\n```\ncd ~/frappe-bench\n```\n\n2. Get plugin from Github\n\n*(Required only once)*\n\n```\nbench get-app https://github.com/kid1194/frappe-better-attach-control\n```\n\n3. Build plugin\n\n*(Required only once)*\n\n```\nbench build --app frappe_better_attach_control\n```\n\n4. Install plugin on a specific site\n\n```\nbench --site [sitename] install-app frappe_better_attach_control\n```\n\n5. Check the [usage](#usage) section below\n\n#### Update\n1. Go to app directory\n\n```\ncd ~/frappe-bench/apps/frappe_better_attach_control\n```\n\n2. Get updates from Github\n\n```\ngit pull\n```\n\n3. Go to bench directory\n\n```\ncd ~/frappe-bench\n```\n\n4. Build plugin\n\n```\nbench build --app frappe_better_attach_control\n```\n\n5. Update a specific site\n\n```\nbench --site [sitename] migrate\n```\n\n6. (Optional) Restart bench to clear cache\n\n```\nbench restart\n```\n\n#### Uninstall\n1. Go to bench directory\n\n```\ncd ~/frappe-bench\n```\n\n2. Uninstall plugin from a specific site\n\n```\nbench --site [sitename] uninstall-app frappe_better_attach_control\n```\n\n3. Remove plugin from bench\n\n```\nbench remove-app frappe_better_attach_control\n```\n\n4. (Optional) Restart bench to clear cache\n\n```\nbench restart\n```\n\n---\n\n### Usage\n1. Go to Customization \u003e Customize Form\n2. Enter the form doctype (Ex: 'User')\n3. Scroll down to the fields area\n4. Create an **Attach** or **Attach Image** field or edit an existing custom field\n5. Inside the field's **Options** property, add the options you want as a JSON string.\n\n    Ex: ```{\"allowed_file_types\": [\".jpg\", \".png\", \".gif\"]}```\n\n##### ⚠️ Remember\nYou can't modify the original fields of a doctype, so create a new field or clone and modify the entire doctype.\n\n---\n\n### Available Field Options\n| Option | Description |\n| :--- | :--- |\n| **dialog_title** | Upload dialog title to be displayed ️(🔶Frappe \u003e= v14.0.0).\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```\"Upload Images\"```\u003cbr /\u003e🔹Default: ```\"Upload\"``` |\n| **upload_notes** | Upload text to be displayed.\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```\"Only images and videos, with maximum size of 2MB, are allowed to be uploaded\"```\u003cbr /\u003e🔹Default: ```\"\"``` |\n| **disable_auto_save** | Disable form auto save after upload.\u003cbr /\u003e\u003cbr /\u003e🔹Default: ```false``` |\n| **disable_file_browser** | Disable file browser uploads.\u003cbr /\u003e\u003cbr /\u003e⚠️ *(File browser is always disabled in Web Form)*\u003cbr /\u003e\u003cbr /\u003e🔹Default: ```false``` |\n| **allow_multiple** | Allow multiple uploads.\u003cbr /\u003e\u003cbr /\u003e⚠️ *(Field value is a JSON array of files url)*\u003cbr /\u003e\u003cbr /\u003e🔹Default: ```false``` |\n| **max_file_size** | Maximum file size (in bytes) that is allowed to be uploaded.\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```2048``` for ```2KB```\u003cbr /\u003e🔹Default: ```Value of maximum file size in Frappe's settings``` |\n| **allowed_file_types** | Array of allowed file types (mimes) or extensions to upload. Prefix escaped RegExp string types with ```$```.\u003cbr /\u003e\u003cbr /\u003e⚠️ *(File extensions must have a leading dot \".\")*\u003cbr /\u003e⚠️ *(RegExp string types will not be used to in HTML accept attribute)*\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```[\"image/*\", \"video/*\", \".pdf\", \".doc\", \"$audio\\/([a-z]+)\"]```\u003cbr /\u003e🔹Default: ```null``` or ```[\"image/*\"]``` |\n| **max_number_of_files** | Maximum number of files allowed to be uploaded if multiple upload is allowed.\u003cbr /\u003e\u003cbr /\u003e⚠️ *(Bypassing the maximum attachments of doctype might not work)*\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```4```\u003cbr /\u003e🔹Default: ```Value of maximum attachments set for the doctype``` |\n| **crop_image_aspect_ratio** | Crop aspect ratio for images (🔶Frappe \u003e= v14.0.0).\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```1``` or ```16/9``` or ```4/3```\u003cbr /\u003e🔹Default: ```null``` |\n| **as_public** | Force uploads to be saved in public folder by default.\u003cbr /\u003e\u003cbr /\u003e🔹Default: ```false``` |\n| **allowed_filename** | Only allow files that match a specific file name to be uploaded.\u003cbr /\u003e\u003cbr /\u003e🔹Example: (String)```\"picture.png\"``` or (RegExp String)```\"/picture\\-([0-9]+)\\.png/\"```\u003cbr /\u003e🔹Default: ```null``` |\n| **allow_reload** | Allow reloading attachments (🔶Frappe \u003e= v13.0.0).\u003cbr /\u003e\u003cbr /\u003e🔶 Affect the visibility of the reload button.🔶\u003cbr /\u003e\u003cbr /\u003e🔹Default: ```true``` |\n| **allow_remove** | Allow removing and clearing attachments.\u003cbr /\u003e\u003cbr /\u003e🔶 Affect the visibility of the remove and clear buttons.🔶\u003cbr /\u003e\u003cbr /\u003e🔹Default: ```true``` |\n| **users** 🔴 | Array of custom options for a specific user or group of users.\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```[{\"for\": \"Guest\", \"disabled\": true}, {\"for\": [\"Administrator\", \"user\"], \"allow_multiple\": true}]```\u003cbr /\u003e🔹Default: ```null``` |\n| **roles** 🔴 | Array of custom options for a specific role or group of roles.\u003cbr /\u003e⚠️ *(Custom options for users is prioritized over roles.)*\u003cbr /\u003e\u003cbr /\u003e🔹Example: ```[{\"for\": [\"Administrator\", \"System\"], \"allow_multiple\": true}]```\u003cbr /\u003e🔹Default: ```null``` |\n\n🔴 New - 🔵 Changed\n\n---\n\n### Available JavaScript Methods\n| Method | Description |\n| :--- | :--- |\n| **toggle_auto_save(enable: Boolean !Optional)** 🔵 | Enable/Disable form auto save after upload. |\n| **toggle_reload(allow: Boolean !Optional)** | Allow/Deny reloading attachments and toggle the reload button (🔶Frappe \u003e= v13.0.0). |\n| **toggle_remove(allow: Boolean !Optional)** | Allow/Deny removing and clearing attachments and toggle the clear and remove buttons. |\n| **set_options(options: JSON Object)** | Set or change the plugin options.  |\n\n🔴 New - 🔵 Changed\n\n---\n\n### Supported Fields\n- Attach\n- Attach Image\n\n---\n\n### Issues\nIf you find bug in the plugin, please create a [bug report](https://github.com/kid1194/frappe-better-attach-control/issues/new?assignees=kid1194\u0026labels=bug\u0026template=bug_report.md\u0026title=%5BBUG%5D) and let us know about it.\n\n---\n\n### License\nThis repository has been released under the [MIT License](https://github.com/kid1194/frappe-better-attach-control/blob/main/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkid1194%2Ffrappe-better-attach-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkid1194%2Ffrappe-better-attach-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkid1194%2Ffrappe-better-attach-control/lists"}