Hi,
I would like to download file (Entity with Blob field) via API download page. I’ve a simple entity with fields FileName, FileSize, AppVersion, Data(blob field). I’ve created Datastructure with All fields and then I created API File download page with that Datastructure and FileNameField as FileName and ContentField as Data. MimeType is ?. When I try to get the file via browser, there is http error 404 not found thrown.
I tried to debug it with log4net logger Origam.Server.Pages where I can see only one row :
Then I tried logger Origam.DA.Service.AbstractSqlDataService, if there is any query to database and it is empty. (It doesn’t matter if it’s with or without a Datastructure Method selected). If I test the SQL query generated on Datastrusture Filter from Architect, it shows the data as expected.
What am I doing wrong?
Origam version is 2024.7.0.3446.
Thank you for any advice !!!
The debug log seems to be too short. Are you sure it resolved the API endpoint at all? It seems it did not even try to get anything out of the database.
Could you make a screenshot of the api definition and the URL you are using to call it?
I tried it with/without filter set (there is only one record in database), tried different Mime types - application/zip, application/octet-stream, *. The request I generate from browser or GET method from SOAP UI.
SQL query generated by Architect (Show SQL on FilterSet) for datastructure TTD_CoderDeviceApplication_API_download
-- SQL statements for data structure: TTD_CoderDeviceApplication_API_download
DECLARE @TTD_CoderDeviceApplication_parAppVersion AS NVarChar(100);
SET @TTD_CoderDeviceApplication_parAppVersion = NULL
-----------------------------------------------------------------
-- TTD_CoderDeviceApplication
-----------------------------------------------------------------
SELECT
[TTD_CoderDeviceApplication].[FileName] AS [FileName],
[TTD_CoderDeviceApplication].[Data] AS [Data],
[TTD_CoderDeviceApplication].[AppVersion] AS [AppVersion]
FROM
[TTD_CoderDeviceApplication] AS [TTD_CoderDeviceApplication]
WHERE (
([TTD_CoderDeviceApplication].[AppVersion] = @TTD_CoderDeviceApplication_parAppVersion));