https://github.com/anduin2017/jquery-progress-upload
A library to show progress and open button for file uploader.
https://github.com/anduin2017/jquery-progress-upload
Last synced: about 1 year ago
JSON representation
A library to show progress and open button for file uploader.
- Host: GitHub
- URL: https://github.com/anduin2017/jquery-progress-upload
- Owner: Anduin2017
- License: mit
- Created: 2018-05-02T19:40:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-01-02T17:44:19.000Z (over 1 year ago)
- Last Synced: 2025-04-01T23:35:53.110Z (about 1 year ago)
- Language: HTML
- Homepage:
- Size: 383 KB
- Stars: 9
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-progress-upload
[](https://www.npmjs.com/package/jquery-progress-upload)
[](https://gitlab.aiursoft.cn/anduin/jquery-progress-upload/-/commits/master?ref_type=heads)
A library to show progress and open button for file uploader.
## How to install
```bash
npm install jquery-progress-upload
```
And add your reference:
```html
```
## How to use
### Client side
Create a form
```html
```
Add add the following javascript.
```javascript
var settings = { };
$('#file').setProgressedUploader(settings);
```
Run your app and upload a file.
### Server side
Create a new action at `/api/upload` and save that file.
For example:(In C#)
```C#
var file = Request.Form.Files.First();
var fileStream = new FileStream(GetCurrentDirectory(), FileMode.Create);
await file.CopyToAsync(fileStream);
```
## API
```javascript
var settings = {
onInit: function (elements) {
//Occurs when element loads.
},
onGetFile: function (elements) {
//Occurs when user put a file in it.
},
onStartSubmitting: function (elements) {
//Occurs when user is submitting the form.
},
onProcessing: function (elements) {
//Occurs when all data transformed.
},
onFinish: function (elements, data) {
//Occurs when server gives response.
},
onError: function(e){
//Occurs when server could not accept the file.
}
};
$('#file').setProgressedUploader(settings);
```