Filebeam
1.0.0
A simple GoLang service that allows file uploads with configurable options.
git clone https://github.com/Anas-Qadil/Filebeamcd Filebeamgo build./FilebeamThe service can be configured by modifying the Config struct in the main.go file:
type Config struct {
// Max file size allowed for uploads
MaxFileSize int64;
// Allowed file types for uploads
AllowedFileTypes []string;
// Upload directory
UploadDir string;
// Generate unique filenames
GenerateUniqueFilenames bool;
}
func main() {
config := Config{
MaxFileSize: 32 << 20, // 32MB
AllowedFileTypes: []string{".jpg", ".jpeg", ".png", ".gif"},
UploadDir: "uploads/",
GenerateUniqueFilenames: true,
}
// ...
}Make sure to adjust the configuration according to your requirements before running the service.
Once the service is running, you can upload files by sending a POST request to http://localhost:8080/upload.
The uploaded files will be stored in the configured upload directory.
To change the upload directory, modify the UploadDir field in the Config struct.
This project is licensed under the MIT License. See the LICENSE file for details.