We're Hiring!

Mattermost Discussion Forums

Other users can not download my uploaded files

Summary
Other users can not download my uploaded files and they got “detailed_error”:“UserRequired” error.

Steps to reproduce
I am using the v5.38.0.

  1. Upload a file in a channel using the POST endpoint “/files”
  2. Send it with a post using the POST endpoint “/posts”
  3. File is sent properly, I can download it, but other people after clicking it the URL “/files/{file_id}?download=1” returns a JSON error:
{"id":"api.context.session_expired.app_error","message":"Sesión inválida o vencida, por favor inicia sesión otra vez.","detailed_error":"UserRequired","request_id":"1cfhe451xpd3jnijwohfpf3oqe","status_code":401}

Expected behavior
At previous step 3, the download should just start for the other people as when I click on it.

Observed behavior

  1. After upload file:
    Error1 — ImgBB
  2. After send post with the file attached:
    Error2 — ImgBB
  3. If another user in channel that is not me clicks on the button, the error is thrown:
{"id":"api.context.session_expired.app_error","message":"Sesión inválida o vencida, por favor inicia sesión otra vez.","detailed_error":"UserRequired","request_id":"1cfhe451xpd3jnijwohfpf3oqe","status_code":401}

This is developed using a React app and connecting Mattermost server using HTTP requests.

Thank you for your help!

1 Like

I could resolve this just using the endpoint “/file_id/link”.

So this post can be resolved.

Thanks