Skip to content

Commit 3921a08

Browse files
committed
apparently twitter docs say you should use media[] -_-
1 parent bbb5576 commit 3921a08

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

twitterv1/interaction.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,13 @@ func status_update_with_media(c *fiber.Ctx) error {
7878
status := c.FormValue("status")
7979

8080
// The docs say it's an array, but I can only upload one imageData.... so idk
81-
imageData, err := c.FormFile("media")
81+
imageData, err := c.FormFile("media") // i love it when things dont follow the docs
8282
if err != nil {
83-
fmt.Println("Error:", err)
84-
return ReturnError(c, "Please upload an image", 195, fiber.StatusForbidden)
83+
imageData, err = c.FormFile("media[]")
84+
if err != nil {
85+
fmt.Println("Error:", err)
86+
return ReturnError(c, "Please upload an image", 195, fiber.StatusForbidden)
87+
}
8588
}
8689

8790
// read the image file content

0 commit comments

Comments
 (0)