Skip to content

Commit 65fae65

Browse files
committed
add readme, set expire time to 5mins
1 parent dd0ced2 commit 65fae65

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1+
12
# gupload
2-
Serve an HTTP server to transfer files between machines on the local network
3+
4+
This is a simple HTTP server which allows you to transfer files to and from a machine on the local network.
5+
6+
It's a rewrite of the [old Python version](https://github.com/ac04-dump/dump/tree/main/uploader) in combination with some features of [sharebox](https://github.com/ac04-dump/sharebox) and even some additions.
7+
8+
I use it to transfer some files quickly to/from devices on my local network, mostly Android/iOS/Windows ones.
9+
10+
**Warning:**
11+
The transfer happens over plain HTTP, so it's *unencrypted*.
12+
13+
## Build Instructions
14+
15+
```sh
16+
go build .
17+
```

handlers.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ import (
1313
"github.com/gin-gonic/gin"
1414
)
1515

16-
var AutoDeleteMap map[string]int = map[string]int{}
16+
var (
17+
DeleteTimeout = 60 * 5
18+
AutoDeleteMap map[string]int = map[string]int{}
19+
)
1720

1821
func HandlerIndex(c *gin.Context) {
1922
RetPage(c, []string{})
@@ -41,7 +44,7 @@ func HandlerUpload(c *gin.Context) {
4144

4245
messages = append(messages, fmt.Sprintf("'%s' was uploaded successfully", filename))
4346
if len(autodelete) > 0 && autodelete[0] == "on" {
44-
AutoDeleteMap[filename] = 60 * 1
47+
AutoDeleteMap[filename] = DeleteTimeout
4548
}
4649

4750
go func() {

0 commit comments

Comments
 (0)