Skip to content

Commit

Permalink
version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadgamal99 committed Sep 3, 2022
1 parent 49d5bd3 commit 6ced14c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,56 @@
# Multiple-Uploader.js
This library is used to upload multiple images with previewing them realtime

Multiple Uploader is a pure javaScript library that uploads multiple images with previewing them realtime.

It's fully configurable, can be styled according to your needs.

<div align="center">
<img width="674" alt="Multiple Uploader Gif" src="https://s4.gifyu.com/images/multiple-uploader.gif">
</div>

## Quickstart

After Downloading files just add these lines of code:

```html

<form action="" method="" enctype="multipart/form-data" ></form>

<div class="multiple-uploader" id="multiple-uploader">
<div class="mup-msg">
<span class="mup-main-msg">click to upload images.</span>
<span class="mup-msg" id="max-upload-number">Upload up to 10 images</span>
<span class="mup-msg">Only images, pdf and psd files are allowed for upload</span>
</div>
</div>

<script src="./src/js/multiple-uploader.js"></script>
<script>
let multipleUploader = new MultipleUploader().init({
maxUpload : 20, // maximum number of uploaded images
maxSize:2, // size in mega bytes
filesInpName:'images', // input name attribute that is sent to backend
formSelector: 'form', // form selector, you can provide the id of the form such as #myForm
});
multipleUploader.clear(); // this function clears all uploaded images
</script>
```


---

> ⚠️ **NOTE**: We are currently support uploading images only
## Main features ✅

- Image thumbnail previews.
- Image sizes previews on hover.
- Deleting uploaded images.
- Set maximum size for the images.
- Set maximum number of uploaded images.
- Well tested.

# MIT License
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>
<body>

<form action="/test" method="post" ></form>
<form action="" method="" enctype="multipart/form-data" ></form>

<div class="multiple-uploader" id="multiple-uploader">
<div class="mup-msg">
Expand All @@ -17,7 +17,7 @@
</div>
</div>

<script src="./src/js/multiple-uploader.js" ></script>
<script src="./src/js/multiple-uploader.js"></script>
<script>

let multipleUploader = new MultipleUploader().init({
Expand Down
5 changes: 4 additions & 1 deletion src/css/main.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@


.multiple-uploader {
display: flex;
flex-wrap: wrap;
justify-content: center;
border-radius: 15px;
border: 2px dashed #858585;
min-height: 150px;
margin: 10px 20px;
margin: 20px auto;
cursor: pointer;
width: 80%;
}

.mup-msg {
Expand Down

0 comments on commit 6ced14c

Please sign in to comment.