Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.X - 2026-X
- Allow `file` to be an array for `IImportDataOptions`

### 1.51.5 - 2026-06-22
- Pass `auditUserComment` option to `Storage.deleteStorageItem` for attaching a reason to the audit log record

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/api",
"version": "1.52.0",
"version": "1.52.1-fb-genBank.1",
"description": "JavaScript client API for LabKey Server",
"scripts": {
"build": "npm run build:dist && npm run build:docs",
Expand Down
10 changes: 8 additions & 2 deletions src/labkey/dom/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export interface IImportDataOptions {
auditUserComment?: string;
containerPath?: string;
failure?: Function;
file?: File | Element | any;
file?: File | File[] | Element | any;
format?: string;
importIdentity?: any;
importLookupByAlternateKey?: boolean;
Expand Down Expand Up @@ -167,7 +167,13 @@ export function importData(options: IImportDataOptions): XMLHttpRequest {
}

if (options.file) {
if (options.file instanceof File) {
if (Array.isArray(options.file)) {
options.file.forEach(f => {
if (f instanceof File) {
form.append('file', f);
}
});
} else if (options.file instanceof File) {
form.append('file', options.file);
} else if (options.file.tagName == 'INPUT' && options.file.files.length > 0) {
form.append('file', options.file.files[0]);
Expand Down