Skip to content

Error 406 while uploading attachments #574

Answered by mozts2005
josipkedves asked this question in Q&A
Discussion options

You must be logged in to vote

Please, create a test case that replicates the issue and send a pull request.

here is the current test case that is passing.

https://github.com/Speedygeek/ZendeskApi_v2/blob/94082b6d7a81bbbf127c7a443fd783b6e9f1e764/tests/ZendeskApi_v2.Tests/AttachmentTests.cs#LL17C1-L26C1

[Test]
public void CanUploadAttachments()
{
    var res = Api.Attachments.UploadAttachment(new ZenFile()
      {
        ContentType = = "text/plain",
        FileName = "testupload.txt",
        FileData = File.ReadAllBytes(Path.Combine(TestContext.CurrentContext.TestDirectory,"testupload.txt"))
     });
    Assert.That(!string.IsNullOrEmpty(res.Token), Is.True);
}

Note: The Content-Type must contain a recognized MIME t…

Replies: 3 comments 2 replies

Comment options

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

@mozts2005
Comment options

Answer selected by josipkedves
Comment options

You must be logged in to vote
0 replies
Comment options

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