OGE logoOGE

Upload API

Every public member of <oge-file-uploader>, its two companion directives and the transport contract. Back to the demos →

Properties Methods Events Types

OgeFileUploader

oge-file-uploader

Properties 40

Selection

Name Type DefaultDescription
acceptstring''The accept attribute of the file input. Also filters drops and pastes, which the browser does not do for you.
multiplebooleantrueAllows several files. With false a new selection replaces the list, which is what every reference does.
directorybooleanfalseLets the dialog pick a folder, and descends into dropped folders. Falls back to the flat file list where the entry API is unavailable.
pastablebooleanfalseAdds files from a paste while the uploader has focus — a pasted screenshot included.
allowDropbooleantrueTurns drag & drop off without hiding the browse affordance.
dropZonestring | undefinedundefinedName this uploader answers to, so [ogeUploadDropZone] and [ogeUploadTrigger] elsewhere can reach it. dx dropZone, Kendo zoneId, Syncfusion dropArea.
dropEffect'copy' | 'move' | 'link' | 'none' | 'default''copy'Pointer feedback while files hover the zone.
fieldNamestring'files[]'Multipart field name, and the name attribute of the file input. Called fieldName because name belongs to the Angular forms contract — Kendo splits it the same way with saveField.
openFileDialogOnClickbooleantrueAnt’s option. false makes the zone drop-only — and stops it being a button, because a button that does nothing on Enter is worse than none; the separate browse button appears instead so the keyboard path survives.
captureboolean | 'user' | 'environment'undefinedThe native capture attribute: opens the camera or microphone directly on mobile instead of the file browser.
transformFile((file: File) =&gt; File | Promise&lt;File&gt;) | undefinedundefinedRewrites each file — compression, watermarking, EXIF stripping. Ant folds this into beforeUpload; keeping it separate from validateFile means a transform cannot accidentally reject. Applied before validation, so the restrictions judge the bytes that will be sent.
thumbnailFor((file: OgeUploadFile) =&gt; string | null | Promise&lt;string | null&gt;) | undefinedundefinedSupplies a preview the browser cannot make itself — a server-rendered PDF thumbnail, a downscaled canvas image. Ant’s previewFile plus isImageUrl: returning null is the "not an image" half.
inputAttributesRecord&lt;string, string&gt;{}Extra attributes for the internal file input, which no Angular binding can reach.

Restrictions

Name Type DefaultDescription
allowedFileExtensionsreadonly string[][].png-style or bare png-style; empty allows everything.
maxFileSize / minFileSizenumber | undefinedundefinedInclusive bounds in bytes. undefined means no limit — an explicit 0 is a real limit, unlike dx, where it is the sentinel.
maxFileCountnumber | undefinedundefinedOnly the files past the limit are rejected, and a rejected file never spends a count slot.
maxTotalFileSizenumber | undefinedundefinedBudget across the whole list. OGE extra.
validateFile((file: File) =&gt; string | null) | undefinedundefinedReturns a message to reject, or null to accept — the validation half of Ant’s beforeUpload.

Transport

Name Type DefaultDescription
uploadUrlstring | ((files: readonly File[]) =&gt; string)''Empty means there is nowhere to send to, and nothing is sent — the uploader stays a picker.
uploadMode'instantly' | 'useButtons' | 'useForm' | 'select''instantly'select never uploads: Kendo’s FileSelect as a mode rather than a second component.
uploadMethod / uploadHeaders / uploadCustomData'post' | 'put' | 'patch' / Record / Record | fn'post' / {} / {}uploadCustomData also takes a per-file function — Ant’s data in both shapes.
withCredentials / responseType / timeoutboolean / 'json' | 'text' | 'blob' / numberfalse / json / undefinedStandard request knobs.
batchbooleanfalseEvery file in one request.
concurrencynumber | undefined3 (config)One number replaces two booleans: Kendo’s concurrent: false and Syncfusion’s sequentialUpload: true are both 1.
chunkboolean | OgeUploadChunkOptionsfalseKendo’s ChunkSettings defaults: size: 1 MiB, autoRetryAfter: 100, maxAutoRetries: 1, resumable: true.
autoRetryboolean | OgeUploadRetryOptionsfalseWhole-file retry; defaults { count: 3, delayMs: 500 }. A run serving its backoff frees its concurrency slot.
uploadAdapterOgeUploadAdapter | undefinedundefinedReplaces the transport wholesale. See createHttpClientUploadAdapter for interceptor support.
abortablebooleantruedx’s allowCanceling.
removeUrl / removeMethod / removeHeaders / removeFieldstring / 'post' | 'delete' / Record / stringundefined / 'post' / {} / 'fileNames'Server-side delete. Only files that actually reached the server are deleted there.

Display

Name Type DefaultDescription
displayMode'full' | 'compact' | 'button''full'PrimeNG’s advanced/basic pair, plus a slim compact bar (OGE extra).
showFileListboolean | OgeUploadFileListOptionstrueThe boolean, or Ant’s options object (showRemove, showRetry, showCancel, showPause, …).
listType / previewWidth'text' | 'picture' | 'pictureCard' / number'text' / 50Preview rendering.
actionsLayout'start' | 'center' | 'end' | 'stretch''end'Where the action row sits.
showUploadButton / showClearButton / showCancelButtonboolean | undefinedundefinedundefined derives visibility from uploadMode — no button that has nothing to do.
initialFilesreadonly OgeUploadPreloadedFile[][]Files that already live on the server — Syncfusion’s files, Ant’s defaultFileList.
messagesPartial&lt;OgeUploadMessages&gt;undefinedPer-instance override, layered over provideOgeUploadConfig().

State and forms

Name Type DefaultDescription
valuemodel&lt;readonly File[]&gt;[]Every row that carries a real File, including invalid ones — hiding them would let required pass while a file is plainly on screen. The validator is what blocks submission.
disabled / readonly / required / invalid / touched / dirty / name / errorsFormValueControl contract—The Signal Forms member names. Never bind these alongside [formField] — express them in the schema.
filesSignal&lt;readonly OgeUploadFile[]&gt;—Read-only. Every row, invalid and preloaded included.
progress / busy / uploadedCount / fileCount / limitExceeded / valid / validationErrorsSignal—Read-only. Replaces dx’s progress/isValid/validationErrors and PrimeNG’s boolean methods.

Methods 12

OgeFileUploader

Name Type Description
upload(uids?)voidStarts the queued transfers. Files that failed a restriction are never sent.
abort(uid?, reason?)voiddx abortUpload, Kendo cancelUploadByUid.
pause(uid) / resume(uid)booleanChunked and resumable transfers only; returns false otherwise rather than aborting and calling it a pause.
retry(uid?)voidWith no argument, everything that failed or was aborted.
addFiles(files)voidAdds files through the same pipeline as a drop.
removeFile(uid) / clear()voidBoth run their cancelable pre-event first.
openFileDialog()voidPrimeNG choose.
getFiles(index?) / sortFiles(compare?)readonly OgeUploadFile[] / voidSyncfusion getFilesData / sortFileList; sorts by name unless told otherwise.
preview(uid) / download(uid)voidOpens the built-in lightbox / downloads the file. Both fire a cancelable event first, so an app can substitute its own viewer or signed-URL flow — Ant’s onPreview and onDownload.
reset(value?)voiddx’s reset: back to a pristine state, clearing touched and dirty. Fires no clearing pipeline — a reset is the app rewinding its form, not the user removing files.
focus() / blur()voidMoves focus to the browse affordance.
formatFileSize(bytes, options?)stringExported free function — PrimeNG formatSize, Syncfusion bytesToSize.

Events 12

Selection

Name Type Description
filesSelectingOgeUploadFilesSelectingEventCancelable. Before anything is validated or added. Carries the source: dialog, drop, paste or api.
filesSelected / fileRejected / filesDroppedeventfileRejected fires once per file that failed a restriction — OGE extra; the references only render a message.
dropZoneEntered / dropZoneLeftOgeUploadDropZoneEventdx onDropZoneEnter / onDropZoneLeave.

Transfers

Name Type Description
uploadingOgeUploadUploadingEventCancelable, and the one place the outgoing request is writable — dx’s onBeforeSend.
uploadStarted / uploadProgress / uploaded / uploadFailed / uploadAborted / allUploadedeventuploadStarted fires when a request actually goes out — not when the file is queued, and again on a retry.
chunkUploading / chunkUploaded / chunkFailedeventchunkUploading is cancelable, per slice.
uploadPausing / uploadPaused / uploadResuming / uploadResumedeventThe -ing halves are cancelable.

List

Name Type Description
fileRemoving / fileRemovedeventfileRemoving is cancelable and reports whether a server delete will follow.
clearing / clearedeventclearing is cancelable.
previewShowing / previewHiddeneventpreviewShowing is cancelable — veto it to open your own viewer instead of the built-in lightbox.
fileDownloadingOgeUploadFileDownloadingEventCancelable. The default is an anchor click against the server url, or a temporary object URL for a file that only exists locally.
thumbnailFailed / valueChange / toucheventPreview decode failure, the two-way model, and the forms contract.

Types 16

Types

Name Type Description
OgeUploadFileinterfaceuid, name, size, type, file, status, loaded, progress, errors, response, httpStatus, chunk, attempts, plus bytesPerSecond and secondsRemaining (OGE extra).
OgeUploadFileStatusunion'pending' | 'uploading' | 'paused' | 'uploaded' | 'failed' | 'aborted' | 'invalid' | 'removed'.
OgeUploadAdapterinterfacesend(parts, request, callbacks) and optional remove(...). Batch versus per-file is the shape of the argument, not a flag.
OgeUploadChunkMetadatainterfaceKendo’s ChunkMetadata field for field, so a Kendo-shaped server needs no changes.
OGE_UPLOAD_TRANSPORTInjectionTokenThe default adapter. Override it in tests and demos; jsdom’s XHR performs real network I/O.
provideOgeUploadConfig(config)ProviderApp-wide defaults and messages — five nested message blocks: buttons, dropZone, status, validation, announcements.
OgeUploadDropZonedirective — <code>[ogeUploadDropZone]</code>Turns any element into a drop target for the uploader whose dropZone matches the given name. Exposes an over signal for your own hover styling.
OgeUploadTriggerdirective — <code>[ogeUploadTrigger]</code>Opens an uploader’s file dialog from a button elsewhere on the page — dx’s dialogTrigger. Disables itself while no uploader answers to that name.
createXhrUploadAdapter()() =&gt; OgeUploadAdapterThe default transport, and the value behind OGE_UPLOAD_TRANSPORT. Exported so a custom adapter can delegate to it.
createHttpClientUploadAdapter(http)(http: HttpClient) =&gt; OgeUploadAdapterRuns transfers through Angular’s HttpClient, so interceptors (auth, tracing) apply. @angular/common/http is passed in, never imported by the package.

Template directives

Name Type Description
OgeUploadFileTemplatedirective — <code>*ogeUploadFileTemplate</code>Replaces one file row. Context: $implicit (the file), index, and the pre-formatted size and status. Covers PrimeNG’s file/filelabel, Syncfusion’s template and Ant’s itemRender.
OgeUploadHeaderTemplatedirective — <code>*ogeUploadHeaderTemplate</code>Replaces the strip above the list. Context: the files, count, uploadedCount and a pre-formatted totalSize.
OgeUploadDropZoneTemplatedirective — <code>*ogeUploadDropZoneTemplate</code>Replaces the drop zone’s contents. Context: $implicit is true while files hover, plus disabled.
OgeUploadEmptyTemplatedirective — <code>*ogeUploadEmptyTemplate</code>Rendered in place of the list while nothing is selected.
OgeUploadToolbarTemplatedirective — <code>*ogeUploadToolbarTemplate</code>Replaces the Upload/Clear action row. Context: the files and uploading.
OgeUploadIconTemplatedirective — <code>*ogeUploadIconTemplate</code>Replaces one glyph. $implicit is an OgeUploadIconSlot — 14 values covering PrimeNG’s four icon slots and Ant’s three, in one directive instead of seven inputs.