Beispiel #1
0
func (c App) Upload(fname string, fid string, n string) revel.Result {
	user := new(models.User)
	user.Id = "6964943e-535a-4736-85ad-4baaa9656709"

	// Put the upload logic here
	// and then call FileUploaded() to add the metadata
	u := models.UserConfigData{Token: make(map[string]string)}
	f := models.FileMappingData{Parts: make(map[string]map[string]string)}
	u.Token["google"] = "/tmp/token"

	nn, _ := strconv.Atoi(n)
	models.UploadFiles("/tmp/"+fid, fname, nn, &u, &f)

	models.FileUploaded(user.Id, f.Parts, fid, fname)

	return c.Render()
}
Beispiel #2
0
func (c App) List() revel.Result {
	user := new(models.User)
	user.Id = "6964943e-535a-4736-85ad-4baaa9656709"
	return c.Render(user)
}