root-gg / plik

Plik is a temporary file upload system (Wetransfer like) in Go.

Home Page:https://plik.root.gg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GO: How to get direct download link?

mizzunet opened this issue · comments

commented
func uploadFile(f string) string {
	client := plik.NewClient("https://plik.root.gg")

	upload := client.NewUpload()
	file, err := upload.AddFileFromPath(f)

	err = file.Upload()
	if err != nil {
		log.Println("some erre", err)
	}
	uploadURL, err := upload.GetURL()
	return uploadURL.String()
}

Here, uploadURL is just an URL to open the download page. How do I get this file's direct downoad link?

Hi @mizzunet

// Each file has it's own direct download URL
fileURL, err := file.GetURL()
commented

Thanks (: