Kaedrick
Kaedrick
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
good night sir
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
but for now, some sleep
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
oh okay! thank you so much you were so helpful I feel like maybe tomorrow or the day after I'll have this damn API upload thing working <:gx_Sunglasses_cry:750469526667264051>
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
it won't let me lol
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
ffs
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
in (' \ ')
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
just to be sure i understand
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
can you explain why there's 2 \ ?
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
tyvm!!
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
ohhh
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
tyvm!
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
perfect
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
ok it works even if there's less " \ " in the path
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
*the last " \ "
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
so if the full path is : C:\Users\secret\OneDrive\Images\secret.png how do I split it so it always takes what comes after the last "" ?
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
how do I get the chosen file name, since "productPicture.FileName" actually returns the picture's whole path and not just its name ?
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
one more thing before I go to sleep and do the rest tommorow
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
okay that actually is cool, and for once I understand lol thanks
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
woops not sure why it quoted the c# part too
107 replies
CC#
Created by Kaedrick on 12/21/2022 in #help
❔ Problem with image hosting API
so in the page you sent me to send the image to an API, regarding this section :

var filePath = @"C:\house.png";

using (var multipartFormContent = new MultipartFormDataContent())
{
//Load the file and set the file's Content-Type header
var fileStreamContent = new StreamContent(File.OpenRead(filePath));
fileStreamContent.Headers.ContentType = new MediaTypeHeaderValue("image/png");

//Add the file
multipartFormContent.Add(fileStreamContent, name: "file", fileName: "house.png");

var filePath = @"C:\house.png";

using (var multipartFormContent = new MultipartFormDataContent())
{
//Load the file and set the file's Content-Type header
var fileStreamContent = new StreamContent(File.OpenRead(filePath));
fileStreamContent.Headers.ContentType = new MediaTypeHeaderValue("image/png");

//Add the file
multipartFormContent.Add(fileStreamContent, name: "file", fileName: "house.png");
I'm not sure how to proceed since "house.png" has to be the selected file name here, and that "image/png" should be "image/whatever the chosen image format is"
107 replies