Hello.
I have problem with downloading documents (-4 Error).
In my project i use OnlyOfficeEditor and OnlyOfficeConverter. OnlyOffice launched with docker.
I use MinIO for file storage. And there are 2 options in MinIO : private and public buckets. I used public bucket and all worked well. But i need to use privite bucket and i make temporary url with signature. So i pass this url to “url” param and got error -4.
data for converting
def _prepare_post_data(self, file_relative_url: str) -> dict[str, Any]:
file_absolute_url = self._make_absolute_file_url(file_relative_url=file_relative_url)
payload = {
"async": True,
"filetype": file_relative_url.split(".")[-1],
"key": self.document_key,
"outputtype": self._OUTPUT_TYPE,
"url": file_absolute_url,
"title": self._pure_file_name,
}
header = {
"alg": "HS256",
"typ": "JWT",
}
data = {"token": jwt.encode(payload, settings.ONLY_OFFICE_SECRET, algorithm="HS256", headers=header)}
return data
So, this temporary url i pass into browser and got a file.
This temporary urls work in my service.
url looks like this:
public
http://10.10.10.241:9000/law-making-private-test/2024-11-28/6357cebad92c0b510c9c1b0293d7a075/%D0%9F%D0%9E%D0%A1%D0%A2%D0%90%D0%9D%D0%9E%D0%92%D0%9B%D0%95%D0%9D%D0%98%D0%95_%D0%93%D0%9E%D0%A1%D0%A1%D0%A2%D0%90%D0%9D%D0%94%D0%90%D0%A0%D0%A2%D0%90_55_%D0%9E%D0%B1_%D1%83%D1%82%D0%B2%D0%B5%D1%80%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B8_%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB_%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B8_%D1%82%D0%B5%D1%85%D0%BD%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D1%85_%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA%D1%81%D0%BE%D0%B2_%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D0%B2%D1%88%D0%B5%D0%B9%D1%81%D1%8F_%D0%BF%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%BA%D0%B8.docx
privite
http://10.10.10.241:9000/law-making-private-test/2024-11-28/6357cebad92c0b510c9c1b0293d7a075/%D0%9F%D0%9E%D0%A1%D0%A2%D0%90%D0%9D%D0%9E%D0%92%D0%9B%D0%95%D0%9D%D0%98%D0%95_%D0%93%D0%9E%D0%A1%D0%A1%D0%A2%D0%90%D0%9D%D0%94%D0%90%D0%A0%D0%A2%D0%90_55_%D0%9E%D0%B1_%D1%83%D1%82%D0%B2%D0%B5%D1%80%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B8_%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB_%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B8_%D1%82%D0%B5%D1%85%D0%BD%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B8%D1%85_%D0%BA%D0%BE%D0%B4%D0%B5%D0%BA%D1%81%D0%BE%D0%B2_%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D0%B2%D1%88%D0%B5%D0%B9%D1%81%D1%8F_%D0%BF%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%BA%D0%B8.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=vokoOkG71281d0LXZ5KW%2F20241128%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241128T114254Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=b9b7346964dbe3b480a20765e3a25df238f74b9f0a44a54867bf518988ea2879
So difference in query params
if i use public bucket it doesn work with temporary url also
I tried download in container
docker exec -it[id] bash
curl '[url]' --output test.docx
and i got a file inside OnlyOffice container with temporary url
i also tried with .txt files, so i am sure that i realy got file, i saw it with nano.
So, why i can get file inside container with curl, but i got -4 Error?
Thanks for your help.