Kiwi icon indicating copy to clipboard operation
Kiwi copied to clipboard

tcms.rpc.api.user.add_attachment return URL that doesn't work

Open gurkirat1632 opened this issue 1 year ago • 1 comments

Using

tcms.rpc.api.user.add_attachment(filename, b64content, **kwargs)[source] RPC User.add_attachment(filename, b64content)

returns URL and file name. But when try to open the URL it's displaying 404 page not found

Used (https://public.tenant.kiwitcms.org/)

Steps to Reproduce

  1. Try to upload an PNG image using user.add_attachment
  2. Getting response in proper dictionary with URL and file name.
  3. Now try to open the URL in browser when logged in with same user.

Actual results

Dictionary results are: url is :/uploads/attachments/auth_user/15355/TestCheckAttgu.png file is LTestCheckAttgu.png

image

Expected results

404 not found should not be shown

Additional info (Python traceback, logs, etc.)

gurkirat1632 avatar Sep 14 '23 12:09 gurkirat1632

Steps to Reproduce

1. Try to upload an PNG image using user.add_attachment
2. Getting response in proper dictionary with URL and file name.
3. Now try to open the URL in browser when logged in with same user.

I tried but couldn't reproduce. The file was still accessible afterwards.

Can you post the exact version of the tcms-api package you are using and more detailed steps to reproduce.

Actual results

Dictionary results are: url is :/uploads/attachments/auth_user/15355/TestCheckAttgu.png file is LTestCheckAttgu.png

This isn't a dictionary and your filename LTestCheckAttgu.png doesn't math the resulting URL. Can you post the actual dictionary returned from the Python library to avoid any mismatches or typos ?

atodorov avatar Sep 25 '23 21:09 atodorov