{"id":20121779,"url":"https://github.com/chrismademe/jquery-image-upload","last_synced_at":"2025-03-02T20:22:19.620Z","repository":{"id":117826053,"uuid":"45179770","full_name":"chrismademe/jquery-image-upload","owner":"chrismademe","description":null,"archived":false,"fork":false,"pushed_at":"2015-10-29T16:24:58.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T07:26:19.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/chrismademe.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-10-29T11:47:27.000Z","updated_at":"2015-10-29T11:57:28.000Z","dependencies_parsed_at":"2023-03-13T12:48:22.939Z","dependency_job_id":null,"html_url":"https://github.com/chrismademe/jquery-image-upload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismademe%2Fjquery-image-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismademe%2Fjquery-image-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismademe%2Fjquery-image-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrismademe%2Fjquery-image-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrismademe","download_url":"https://codeload.github.com/chrismademe/jquery-image-upload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241565543,"owners_count":19983142,"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","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-13T19:32:22.718Z","updated_at":"2025-03-02T20:22:19.594Z","avatar_url":"https://github.com/chrismademe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery Image Upload\n\nSimple jQuery plugin to provide instant image uploads via AJAX.\n\n\n## Usage\n\nThe plugin was developed on version 1.9.1 of jQuery but I'm sure it'll work just fine on others.\n\n__Include jQuery and the plugin:__\n```javascript\n\u003cscript src=\"/path/to/jquery.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"/path/to/plugin/jquery.image-upload.js\"\u003e\u003c/script\u003e\n```\n\n_If you need them, include the base styles in the `\u003chead\u003e` of your page._\n```javascript\n\u003clink rel=\"stylesheet\" href=\"/path/to/plugin/jquery.image-upload.css\"\u003e\n```\n\n__Initialise the plugin:__\n```javascript\n\u003cscript\u003e\n$(document).ready(function() {\n    $('#file_input').imageUpload();\n});\n\u003c/script\u003e\n```\n\n__All Options and Callbacks__\n```javascript\n\u003cscript\u003e\n$(document).ready(function() {\n    $('[data-rel=\"image\"]').imageUpload({\n\n        // Defaults to the parent of the file input\n        container: '.container',\n\n        // Array of allow extensions\n        allowed: ['jpg', 'jpeg', 'gif', 'png'],\n\n        // Form ID or element for the form data\n        form: '#form',\n\n        // Script to send AJAX request to\n        handler: 'upload.php',\n\n        // onInit Callback - fired on plugin initilisation\n        onInit: function() {\n            console.log('Plugin initialised');\n        },\n\n        // onSuccess Callback - fired on successful response from AJAX request\n        onSuccess: function() {\n            console.log('Yeeeaahh!!!');\n        },\n\n        // onFail Callback - fired on unsuccessful response from AJAX request\n        onFail: function() {\n            console.log('Ohh snap...');\n        },\n\n        // onError Callback - fired when there was an error sending the AJAX request\n        onError: function() {\n            console.log('It broke.');\n        }\n    });\n});\n\u003c/script\u003e\n```\n\n## IMPORTANT: File type validation\n\nWhilst this plugin can check file extensions, it does nothing else to validate the uploaded file. You must ensure that your server side script is handling file type and extension checking as well. _Never use this plugin in production without the necassary validation server side!!_\n\n## Handling files server-side\n\njQuery Image Upload is a UI tool, it simply makes uploading images instant and more visually pleasing. By default, the plugin will try to upload files to a PHP script `upload.php`. You can override this with the path to your script in when initialising the plugin.\n\n```javascript\n\u003cscript\u003e\n$(document).ready(function() {\n    $('#file_input').imageUpload({\n        'handler': '/path/to/my/script.php'\n    });\n});\n\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrismademe%2Fjquery-image-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrismademe%2Fjquery-image-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrismademe%2Fjquery-image-upload/lists"}