Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknow Server Error when Uploading Img #562

Open
bbday opened this issue Oct 27, 2022 · 7 comments
Open

Unknow Server Error when Uploading Img #562

bbday opened this issue Oct 27, 2022 · 7 comments

Comments

@bbday
Copy link

bbday commented Oct 27, 2022

I use last library version 1.7.4
I using image uploading but i get "uknow server error"
Image 340x425
With library version 1.7.2 i dont have this issue and posted img.

 var mediaImage = new InstaImageUpload
                    {
                        // leave zero, if you don't know how height and width is it.
                        Height = 0,
                        Width = 0,
                        ImageBytes = targetFile.Item1, // byte[] Img
                        //Uri = imgData
                    };

                    var result = await _instagramClient.MediaProcessor.UploadPhotoAsync(mediaImage, SettingModel.Instance.PostData);
                    if (result.Succeeded)
                    {
                        Console.WriteLine("[" + DateTime.UtcNow.ToShortTimeString() + "] posted Img");
                        File.Delete(targetFile.Item2);
                    }
                    else
                    {
                        Console.WriteLine("[" + DateTime.UtcNow.ToShortTimeString() + $"] Unable to upload : {targetFile.Item2} " + result.Info.Message);
                    }
@CarlosTorrecillas
Copy link

I have the same issue after upgrading to v1.7.4 - Error=Unknown: Unknown Server Error. Would be nice if we can get some feedback about how to fix it

@fabiomoroni
Copy link

Hello, I have the same issue in this version v1.7.4.

@pavini
Copy link

pavini commented Feb 24, 2023

Hello, I have the same issue in this version v1.7.4. Any feedback about to fix it?
I´m running on a console app with .net 7.

@clamchoda
Copy link

The problem is the newly generated GenerateRandomUploadId produces an id that causes ConfigureMediaPhotoAsync to fail.

Changing GenerateRandomUploadId back fixes this

internal static string GenerateRandomUploadId()
{
    return DateTime.UtcNow.ToUnixTimeMiliSeconds().ToString();
   // return GenerateUploadId();
}

@demetrebadzaradze
Copy link

a have same problem now so i will change version and error will be gone??

@clamchoda
Copy link

a have same problem now so i will change version and error will be gone??

This issue is in the latest version I believe. In ApiRequestMessage.cs just replace the return value in GenerateRandomUploadId with return DateTime.UtcNow.ToUnixTimeMiliSeconds().ToString(); in the source or use a version prior to this commit.

@Beblia
Copy link

Beblia commented Oct 28, 2023

Getting the same issue. Can you please fix this in the next release? Currently using 1.7.2 to go around this issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants