Filebeam
1.0.0
구성 가능한 옵션으로 파일을 업로드 할 수있는 간단한 Golang 서비스.
git clone https://github.com/Anas-Qadil/Filebeam cd Filebeamgo build./Filebeammain.go 파일에서 구성 구조물을 수정하여 서비스를 구성 할 수 있습니다.
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 ,
}
// ...
}서비스를 실행하기 전에 요구 사항에 따라 구성을 조정하십시오.
서비스가 실행되면 http : // localhost : 8080/upload에 게시물 요청을 보내서 파일을 업로드 할 수 있습니다.
업로드 된 파일은 구성된 업로드 디렉토리에 저장됩니다.
업로드 디렉토리를 변경하려면 구성 구조물에서 업로드 디르 필드를 수정하십시오.
이 프로젝트는 MIT 라이센스에 따라 라이센스가 부여됩니다. 자세한 내용은 라이센스 파일을 참조하십시오.