0

I'am trying to get case attachment to save in local folder. I have problem with using attachment url to download it, each time server returns empty results and status code 200.

This is a sample url I use (changed host and token) :

https://example.fogbugz.com/default.asp?pg=pgDownload&pgType=pgFile&ixBugEvent=385319&ixAttachment=56220&sFileName=Log.7z&sTicket=&sToken=1234567890627ama72kaors2grlgsk

I have tried using token instead of sToken but no difference. If I copy above url to chrome then it won't work either, but If I login to FogBugz (manuscript) and then try this url again then it works. So I suppose there are some security issues here.

btw. I use python FogBugz api for this and save url using urllib urllib.request.urlretrieve(url, "fb/" + file_name)

marcinj
  • 48,511
  • 9
  • 79
  • 100
  • This may help? https://stackoverflow.com/questions/46521253/exporting-case-details-from-fogbugz/46521254#46521254 – Paul Aug 22 '18 at 08:38
  • @Paul I have seen your code and it didn't work for me, only after adding chrome cookies to the request (when I was logged in to FB/manuscript) I could download attachment. Does this code from your answer still work for you? – marcinj Aug 23 '18 at 00:28

1 Answers1

0

Solution I have found is to use cookies from the web browser where I have previously loged in to FB account I use. So it looks like a security issue.

For that I used pycookiecheat (for windows see my fork: https://github.com/luskan/pycookiecheat). For full code see here: https://gist.github.com/luskan/66ffb8f82afb96d29d3f56a730340adc

marcinj
  • 48,511
  • 9
  • 79
  • 100