Successfully using the Mantis SOAP API (aka "MantisConnect") from C#, I can successfully read an issue and also get the download_url
field.
When trying to download the attachment by something like this:
using (var request = new WebClient())
{
request.Credentials = new NetworkCredential("username", "password");
return request.DownloadData(mantisAtt.download_url);
}
it "downloads" a HTML page with the login screen instead of the binary attachment content.
So my question is:
How can I programmatically download an attachment for an issue in Mantis?
I was on the completely wrong track. Instead of following the download URL being returned I now use the function mc_issue_attachment_get
and everything works as expected.
So to solve, do not download from the URL but simply use the intended SOAP API function.
(I found the solution after posting my question to the "mantisbt-soap-dev" mailing list and got a fast reply)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With