Skip to content

Commit

Permalink
Dropzone will now automatically upload files when dropped or selected…
Browse files Browse the repository at this point in the history
… to resolve issue #59
  • Loading branch information
patrickhener committed Apr 30, 2024
1 parent c8e2a5c commit 7a0bd37
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Version](https://img.shields.io/badge/Version-v0.3.7-green)
![Version](https://img.shields.io/badge/Version-v0.3.8-green)
[![GitHub](https://img.shields.io/github/license/patrickhener/goshs)](https://github.com/patrickhener/goshs/blob/master/LICENSE)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/patrickhener/goshs)
[![GitHub issues](https://img.shields.io/github/issues-raw/patrickhener/goshs)](https://github.com/patrickhener/goshs/issues)
Expand Down Expand Up @@ -109,11 +109,11 @@ Usage examples:
Start with wevdav support: ./goshs -w
Start with different port: ./goshs -p 8080
Start with self-signed cert: ./goshs -s -ss
Start with let's encrypt: ./goshs -s -sl -sle [email protected] -sld your.domain.com,your.seconddomain.com
Start with let's encrypt: ./goshs -s -sl -sle [email protected] -sld your.domain.com,your.seconddomain.com
Start with custom cert: ./goshs -s -sk <path to key> -sc <path to cert>
Start with basic auth: ./goshs -b secret-user:$up3r$3cur3
Start with basic auth empty user: ./goshs -b :$up3r$3cur3
Start with cli enabled: ./goshs -b secret-user:$up3r$3cur3 -s -ss -c
Start with cli enabled: ./goshs -b secret-user:$up3r$3cur3 -s -ss -c
```

# Examples
Expand Down
3 changes: 1 addition & 2 deletions httpserver/static/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ <h1>Upload File</h1>
<div class="input-group">
<div class="dropzone form-control" id="mydropzone">
<div class="dz-message" data-dz-message><span>Drag & Drop files here or click to
select. Submit with button on the right</span></div>
select. Files will be uploaded automatically.</span></div>
</div>
<button type="submit" id="submit-dropzone" class="btn btn-primary">+</button>
</div>

</form>
Expand Down
11 changes: 1 addition & 10 deletions httpserver/static/templates/scripts_index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,14 @@

<script>
let myDropzone = new Dropzone("div#mydropzone", {
autoProcessQueue: false,
autoProcessQueue: true,
paramName: "files",
method: "post",
url: url,
uploadMultiple: true,
parallelUploads: 100,
maxFiles: 100,
maxFilesize: 10240,

init: function () {
document.querySelector("button[type=submit]#submit-dropzone").addEventListener("click", function (e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
})

}
});

myDropzone.on("successmultiple", function () {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/patrickhener/goshs/utils"
)

const goshsVersion = "v0.3.7"
const goshsVersion = "v0.3.8"

var (
port = 8000
Expand Down

0 comments on commit 7a0bd37

Please sign in to comment.