Hey im trying to upload image to server but keep getting 503 service unavailable or error code 1200..Cuz i know server too busy but the others can upload their images succesfully what am i doing wrong?
Here is my code;
private async Task UploadImage()
{
while (true)
{
try
{
var request = new HttpRequestMessage(HttpMethod.Post, "Submission/Home/AjaxPhotoUpload");
var content = new MultipartFormDataContent
{
{
new StreamContent(File.OpenRead(_citizen.PhotoPath)), _citizen.imageUpload , _citizen.FileNameWithExt},
{ new StringContent("-1"), "subDocIndex" }
};
request.Content = content;
var response = await _httpClient.SendAsync(request);
if (response.IsSuccessStatusCode)
{
Console.WriteLine("uploaded image");
break;
}
else
{
Console.WriteLine("FAILED to upload image");
}
// var result = await response.Content.ReadAsStringAsync();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}