Banny
January 8, 2021, 12:06pm
1
I have…
I’m submitting a…
[ ] Regression (a behavior that stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[X] Documentation issue or request
Current behavior
I got the id of the asset from content.
And I got the picture in assets but I wanna to get the asset in blob storage directly.
I found the picture stored in blob storage have different name from the id.
The name in blob storage have prefix and suffix.
How can I get the name of the asset in blob storage?
Expected behavior
api can also return the id of assets in blob storage.
Minimal reproduction of the problem
Environment
[X] Self hosted with docker
[ ] Self hosted with IIS
[ ] Self hosted with other version
[ ] Cloud version
Version: [5.4.0]
Browser:
[X] Chrome (desktop)
[ ] Chrome (Android)
[ ] Chrome (iOS)
[ ] Firefox
[ ] Safari (desktop)
[ ] Safari (iOS)
[ ] IE
[ ] Edge
Others:
In the blog storage the ID is used. If you edit an asset you get a dialog that shows this ID.
Banny
January 11, 2021, 2:36am
3
Do you mean the Identity in edit mode?
However, the id in blob storage has the prefix and suffix.
And I found that you mention the suffix is “_0” in other topic.
Yes, thats the identity. The file version is added as prefix, so “_0” for the initial upload, “_1” for a new upload / save of the same file and so on.
Banny
January 11, 2021, 8:20am
5
Hi, I think the prefix is the id of the app, but I don’t know how to get it all in one query.
I am using Squidex C# SDK.
Yes, there is an old semantic and a new semantic:
// OLD
private static string GetFileName(DomainId id, long fileVersion)
{
return $"{id}_{fileVersion}";
}
// NEW
private static string GetFileName(DomainId appId, DomainId id, long fileVersion)
{
return $"{appId}_{id}_{fileVersion}";
}
The asset client has this method, which can be used: https://github.com/Squidex/squidex-samples/blob/master/csharp/Squidex.ClientLibrary/Squidex.ClientLibrary/Management/Custom.cs#L128
Banny
January 11, 2021, 8:28am
7
Let me take a look. Thanks.
Banny
January 11, 2021, 9:24am
8
I only found
Task<AssetDto> GetAssetAsync(string app, string id, CancellationToken cancellationToken = default);
in the SDK.
Cannot find the getFileName function.
Get file name is from the server…, I just wanted to show you the different names.
Banny
January 12, 2021, 2:03am
10
Do you mean I should create a function like this? But how can I get the appId?
If you check your chrome network tab, search for a call to /api/apps and check the response. It has a list of apps with their ids.
Banny
January 12, 2021, 7:34am
12
I found the id in the chrome response.
Is there any way to get the id from SDK?
Do you mean I have to hard code the id only?
I would just hardcode it…
Banny
January 12, 2021, 8:06am
14
Okay, I will just hardcode it. Thanks!