[英]How to get image link on acumatica
外部链接只是到/Frames/GetFile.ashx
的链接并传递FileID
,如下所示:
https://test.acumatica.com/Instance/Frames/GetFile.ashx?fileID=bdb9534c-6aa9-41fa-a65d-3119e32b0fe5
要构建此链接,您只需要获取附件的FileID
。 下面的代码正在为当前Inventory Item
的所有附件构建链接。
var currentItem = this.Base.Item.Current;
List<string> links = new List<string>();
if (currentItem!=null)
{
var fileAttachments = PXNoteAttribute.GetFileNotes(this.Base.Item.Cache, currentItem);
foreach (Guid fileId in fileAttachments)
{
links.Add("SITE_URL/INSTANCE_NAME" + "/Frames/GetFile.ashx?fileID=" + fileId);
}
}
请注意/Frames/GetFile.ashx
在访问文件之前需要授权,如果您以隐身方式访问它,您将获得登录表单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.