Skip to content

Go API curl Image Attachments #8899

Answered by AlfarisiN
AlfarisiN asked this question in Q&A
Discussion options

You must be logged in to vote

*Edit :
i fix my problem here

anyway, here is my code for somebody need, hope my code usefull

func NewfileUploadRequest(c* gin.Context) {
url := "http://ip/api/extras/image-attachments/"

token := c.GetHeader("Authorization")
//acc := c.GetHeader("Accept")
//cont := c.GetHeader("Content-Type")
contentType := c.PostForm("content_type")
objectId := c.PostForm("object_id")
imgHeight := c.PostForm("image_height")
imgWidth := c.PostForm("image_width")
imgName := c.PostForm("name")
formFile, _ := c.MultipartForm()
fFile := formFile.File["image"]

var pathImg = ""
var newFileName = ""

extraParams := map[string]interface{}{
	"content_type":contentType,
	"object_id":objectId,
	"name":imgName,
	"im…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@AlfarisiN
Comment options

@markkuleinio
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by AlfarisiN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants