{"id":19963069,"url":"https://github.com/aralejs/upload","last_synced_at":"2026-04-02T01:01:35.598Z","repository":{"id":3585649,"uuid":"4648905","full_name":"aralejs/upload","owner":"aralejs","description":"iframe and html5 file uploader","archived":false,"fork":false,"pushed_at":"2015-11-23T09:08:53.000Z","size":428,"stargazers_count":83,"open_issues_count":13,"forks_count":40,"subscribers_count":25,"default_branch":"master","last_synced_at":"2026-02-11T16:06:20.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://aralejs.org/upload/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aralejs.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-13T09:14:10.000Z","updated_at":"2025-05-25T08:24:13.000Z","dependencies_parsed_at":"2022-09-10T22:41:05.655Z","dependency_job_id":null,"html_url":"https://github.com/aralejs/upload","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/aralejs/upload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aralejs%2Fupload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aralejs%2Fupload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aralejs%2Fupload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aralejs%2Fupload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aralejs","download_url":"https://codeload.github.com/aralejs/upload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aralejs%2Fupload/sbom","scorecard":{"id":205006,"data":{"date":"2025-08-11","repo":{"name":"github.com/aralejs/upload","commit":"fbee8074f11813448bd4441d29d49fe11e1ca18d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T23:32:38.646Z","repository_id":3585649,"created_at":"2025-08-16T23:32:38.646Z","updated_at":"2025-08-16T23:32:38.646Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-13T02:14:38.161Z","updated_at":"2026-04-02T01:01:35.562Z","avatar_url":"https://github.com/aralejs.png","language":"JavaScript","readme":"# Upload\n\n---------------\n\n[![spm package](http://spmjs.io/badge/arale-upload)](http://spmjs.io/package/arale-upload)\n\niframe and html5 uploader.\n\n\u003cspan style=\"font-size:120px;line-height:0.4;color:rgb(255, 140, 42);font-family:Menlo;\"\u003e⇪\u003c/span\u003e\n\n## 演示\n\n查看演示，你需要 clone 一份代码：\n\n```\n$ git clone git://github.com/aralejs/upload\n$ cd upload\n$ npm install\n$ spm install\n$ node server.js\n```\n\n然后访问：http://localhost:8000/demo.html\n\n\n## Attributes\n\n```javascript\nvar uploader = new Uploader({\n    trigger: '#upload-icon',\n    name: 'image',\n    action: '/upload',\n    accept: 'image/*',\n    data: {'xsrf': 'hash'},\n    multiple: true,\n    error: function(file) {\n        alert(file);\n    },\n    success: function(response) {\n        alert(response);\n    },\n    progress: function(event, position, total, percent, files) {\n        console.log(percent);\n    }\n});\n```\n\n### trigger `element|selector`\n\ntrigger 唤出文件选择器，可以是：\n\n    - 选择器\n    - element\n    - jQuery Object\n\n### name `string`\n\nname 即为 `\u003cinput name=\"{{name}}\"\u003e` 的值，即上传文件时对应的 name。\n\n### action `url`\n\naction 为 `\u003cform action=\"{{action}}\"\u003e` 的值，表单提交的地址。\n\n### accept `string`\n\n支持的文件类型，比如 `image/\\*` 为只上传图片类的文件。可选项。\n\n### multiple `boolean`\n\n是否支持多文件上传。默认为 false。\n\n### data `object`\n\n随表单一起要提交的数据。\n\n### error `function`\n\n上传失败的回调函数。\n\n### success `function`\n\n上传成功的回调函数。\n\n### progress `function`\n\n上传的进度回调，不支持 IE9-。回调的参数分别为 ajaxEvent, 当前上传字节，总字节，进度百分比和当前文件列表。\n\n\n## Methods\n\n链式调用:\n\n```javascript\nvar uploader = new Uploader({\n    trigger: '#upload-icon',\n    name: 'image',\n    action: '/upload',\n    data: {'xsrf': 'hash'}\n}).success(function(response) {\n    alert(response);\n}).error(function(file) {\n    alert(file);\n});\n```\n\n## Data API\n\n```html\n\u003ca id=\"upload\" data-name=\"image\" data-action=\"/upload\" data-data=\"a=a\u0026b=b\"\u003eUpload\u003c/a\u003e\n\u003cscript\u003e\nvar uploader = new Uploader({'trigger': '#upload'});\n// more friendly way\n// var uploader = new Uploader('#upload');\nuploader.success(function(response) {\n    alert(response);\n});\n\u003c/script\u003e\n```\n\n## Advanced\n\nDemo in **API** section could not be controlled. When you select a file, it will\nbe submitted immediately. We can broke the chain with ``change``:\n\n```javascript\nvar uploader = new Uploader({\n    trigger: '#upload-icon',\n    name: 'image',\n    action: '/upload',\n    data: {'xsrf': 'hash'}\n}).change(function(files) {\n    for (var i=0; i\u003cfiles.length; i++) {\n        console.log('you are selecting ' + files[i].name + ' Size: ' + files[i].size);\n    }\n    // Default behavior of change is\n    // this.submit();\n}).success(function(response) {\n    alert(response);\n});\n```\n\nNow you should handle it yourself:\n\n```javascript\n$('#submit').click(function() {\n    uploader.submit();\n});\n```\n\n## Show Progress\n\nIt is impossible to show progress, but you can make a fake prgress.\n\n\n```javascript\nvar uploader = new Uploader({\n    trigger: '#upload-icon',\n    name: 'image',\n    action: '/upload',\n    data: {'xsrf': 'hash'},\n    progress: function(e, position, total, percent, files) {\n      $('#progress').text('Uploading ... ' + percent + '%');\n    }\n}).change(function(files) {\n    // before submit\n    $('#progress').text('Uploading ...');\n    this.submit();\n}).success(function(response) {\n    $('#progress').text('Success');\n    alert(response);\n});\n```\n\n\n## Seajs Hint\n\nLoad uploader with seajs:\n\n```javascript\nseajs.use('upload', function(Uploader) {\n    var uploader = new Uploader({\n    });\n});\n```\n\n## Changelog\n\n**2013-12-10** `1.1.0`\n\n1. Add upload progress for html5 uploader\n2. change function argument change to a files list.\n3. fix multiple attribute.\n4. fix this in change function\n5. fix FileList object in ie 9-\n\n**2013-07-18** `1.0.1`\n\n1. Support choosing the same file for uploader\n2. Fix memory leaks for FormData\n\n**2013-06-25** `1.0.0`\n\nCombine iframe and html5 uploader.\n\n## IE hint\n\nhttps://github.com/blueimp/jQuery-File-Upload/issues/1795\n","funding_links":[],"categories":["10. 表单处理"],"sub_categories":["10.4 上传组件 ###","10.5 上传组件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faralejs%2Fupload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faralejs%2Fupload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faralejs%2Fupload/lists"}