0

If an image is attached to that bug, is there a way to ascertain the URL that can be fed to wget in a terminal to download the image? Right-clicking on the image and copying the link does not work (says content-type is text/html). (FogBugz 6.1.46)

flag

3 Answers

1

If you use wget to fetch an attachment, FogBugz will likely redirect it to the login page, which is just an html page. To download attachments, you have to provide the appropriate cookies to wget. See the man page for details, but briefly, you need to have a file with cookies in (you may be able to get this from the browser, or create it yourself) and pass --load-cookies. One way to make a cookies file is with wget itself.

wget --save-cookies cookiejar http://fogbugz/default.asp?pre=preLogon&sPerson=ME&sPassword=SECRET&fRememberPassword=1
link|flag
0

An example of what is being tried. The URL is obtained by right-clicking on the image in the bug and selecting "Copy link location".

wget -S -O test_image_train.jpeg http://fogbugz.mycompany.com/default.php?pg=pgDownload&pgType=pgFile&ixBugEvent=711921&ixAttachment=21150&sTicket=&sFileName=test_image_train.jpeg

link|flag
I think this probably won't work as wget is not logged in as a FogBugz user. – Rich Armstrong Jan 7 2010 at 19:19
Makes sense, thanks. Is there a proper way to formulate the URL to allow the downlowd of the image file from a linux(bash) command line? – Neil Jan 13 2010 at 17:23
0

Hi, I'm the original complainant. Rich, you're probably right about the login issue, but that's not a wholly satisfactory answer, either, because of the browser behavior (i.e. it appears to have incorrectly decided what the MIME type is at some point along the transaction). I'll retry this with my Fogbugz cookies migrated to my wget client.

link|flag
The MIME type is likely being sent down as "text/html" because it's been redirected to the login page during the initial request. Or at least...that's my bet. – db Jan 13 2010 at 18:55

Your Answer

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