1

It is unclear to me how to submit a file (a minidump for example) programmatically (in C++).

I am using libcurl, but since all the examples in the xml api docs/pages show posting from a web page (or .NET which makes web stuff trivial) I seem to be missing some details on how to do a submission.

Is there an example of this I can use?

flag

1 Answer

1

First off, are you looking to use BugzScout or the XML API?

If you're planning to use BugzScout, I'm afriad you won't be able to submit files. This is a limitation of the BugzScout interface.

You can however use the XML API and make it look like a BugzScout submission. You also then have the added benefit of being able to include files as part of your case submission.

I'm not sure if we have a C++ example kicking around, but there are a bunch of FogBugz API wrappers available on our "Extras" page under "Developer Tools" for various languages.

If you're using FogBugz on your own server, there's also a VB.NET example in the Accessories\API\NewCaseVBNet directory that shows an example of including files as part of a new case submission.

Essentially, you just need to format your case submission as a POST request, using multipart/form-data encoding with appropriately named file input fields.

The following is taken from from the FogBugz XML API documentation:

You can also upload an unlimited number of files (constrained only by the max upload limit on the web server).

File1, File2, File3, etc.

To upload files, use the enctype="multipart/form-data" form type and you will need an additional argument nFileCount which contains the number of files (otherwise only the first one will upload).

For example, an html page which submits to the api to create a new case would look like this:

<html>
  <form
    method="post"
    action="http://localhost/fb/api.asp"
    enctype="multipart/form-data"
  >
    <input type=hidden name=cmd value=new />
    <input type=hidden name=token value="CCECOGMBRTPJLFUVFUAAGZCEIEYAC2" />
    <input type=file name=File1 />
    <input type="submit">
  </form>
</html>

You can read more about this encoding type in the RFC.

link|flag
Thanks for the response, but I am afraid it is not all that helpful. I have already read that page/documentation from fogbugz. The link to the RFC is akin to "the proof is left as an exercise for the reader". I have not found RFCs to be very readable or helpful either. Hopefully I can use the .NET APITester code to base my code on. I think perhaps sniffing the html message on the way out will help. – Tim Dec 23 2010 at 16:31

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.