Skip to content

Commit

Permalink
[UPDATE] readme doc about extension check
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas-ggd committed Dec 15, 2024
1 parent d81bca6 commit 8da4662
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ func Upload(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"message": "file chunk processed"})
}
```

`fstream` offers extension check, all you need is that to provide which extension do you want to allow

```go
import(
"github.com/Nicolas-ggd/filestream"
)

// Declare extension slice, slice contains all file extension which is ok for you to allow in your system
var allowExtensions = []string{".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"}

// This function is very simple, but save your time to compare extension and current file to known if it's valid for you
fstream.IsAllowExtension(allowExtensions, "filename.png")
```

## License
FileStream is open-source software licensed under the MIT License.
Expand Down

0 comments on commit 8da4662

Please sign in to comment.