Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public const string SessionKey = "MyFileImportSessionKey";
public PXAction<GLTran> UploadFileBatch;
[PXUIField(DisplayName = "Upload File as Batches", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Visible = true)]
public virtual IEnumerable uploadFileBatch(PXAdapter adapter)
//Ask user to upload file, continue if it is OK
if (this.NewFilePanel.AskExt() == WebDialogResult.OK)
//Retreaving file from session by key
PX.SM.FileInfo info = PXContext.SessionTyped<PXSessionStatePXData>().FileInfo[SessionKey] as PX.SM.FileInfo;
//Binary data will be inside FileInfo
Byte[] bytes = info.BinData;
//Removing file from session to save memory
return adapter.Get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment