Liking cljdoc? Tell your friends :D

fulcro.ui.file-upload

DEPRECATED: See the external file upload demo instead.

DEPRECATED: See the external file upload demo instead.
raw docstring

Abortclj/s≠protocol

abort-sendclj/s

(abort-send this id)

Abort the send with the given ID.

Abort the send with the given ID.
source

add-fileclj/s

source

cancel-file-uploadclj/s

source

clear-upload-list-implclj/s

(clear-upload-list-impl state-map id)

Implementation for a mutation that clears the file list on a file upload input by its ID.

Implementation for a mutation that clears the file list on a file upload input by its ID.
sourceraw docstring

clj->jsclj

source

cropped-nameclj/s

(cropped-name name maxlen)
source

current-filesclj/s

(current-files file-upload)

Returns the current set of files that a file upload component is managing.

Returns the current set of files that a file upload component is managing.
sourceraw docstring

Fileclj/s≠

clj
cljs
(File)
source

file-identclj/s

(file-ident id)
source

file-upload-identclj/s

(file-upload-ident id)

Given a file upload control's ID, returns the ident for that upload control.

Given a file upload control's ID, returns the ident for that upload control.
sourceraw docstring

file-upload-inputclj/s

(file-upload-input name & {:keys [accept multiple? className]})

Namespace DEPRECATED.

Declare (in a form-spec) a field that represents file upload(s).

accept: (optional) String of comma-separated mime types that the files can have. multiple?: (optional) True/false. Can the user upload multiple files? (default false)

Namespace DEPRECATED.

Declare (in a form-spec) a field that represents file upload(s).

`accept`: (optional) String of comma-separated mime types that the files can have.
`multiple?`: (optional) True/false. Can the user upload multiple files? (default false)
sourceraw docstring

file-upload-networkingclj/s

(file-upload-networking)
(file-upload-networking upload-url)

Namespace DEPRECATED. Create an instance of a file upload networking object. You should install one of these as the :file-upload remote in your fulcro client. Upload url defaults to /file-upload, but can be configured (here and on the server)

Namespace DEPRECATED.
 Create an instance of a file upload networking object. You should install one of these as the
`:file-upload` remote in your fulcro client. Upload url defaults to /file-upload, but can
be configured (here and on the server)
sourceraw docstring

FileUploadInputclj/s≠

clj
cljs
(FileUploadInput)
source

FileUploadNetworkcljs

source

get-js-fileclj/s

(get-js-file file-props)

Returns a js/File object for the given file input properties. Useful if you want to do some ui-related operations, such as showing a preview of the file.

Returns a js/File object for the given file input properties. Useful if you want
to do some ui-related operations, such as showing a preview of the file.
sourceraw docstring

handle-file-uploadclj

(handle-file-upload req upload)

Request handler for file uploads. See wrap-file-upload for a middleware version of this.

Request handler for file uploads. See `wrap-file-upload` for a middleware version of this.
sourceraw docstring

IFileUploadcljprotocol

deleteclj

(delete this id)

Ensure that the space consumed by file with id is no reclaimed.

Ensure that the space consumed by file with id is no reclaimed.

is-allowed?clj

(is-allowed? this request)

Return true if the given file upload request is acceptable (e.g. authorized)

Return true if the given file upload request is acceptable (e.g. authorized)

retrieveclj

(retrieve this id)

Return a java.io.File with the content that was previously stored. Id is what store originally returned.

Return a java.io.File with the content that was previously stored. Id is what store originally returned.

storeclj

(store this file)

Save the given file, which is a map containing the filename, content-type, size, and tempfile. Return an ID that this file will be known by with respect to this file upload component.

Save the given file, which is a map containing the filename, content-type, size, and tempfile. Return an ID that this file will be known by with respect to this file upload component.

upload-prefixclj

(upload-prefix this)

Returns the exact URI at which to install the file upload POST handler.

Returns the exact URI at which to install the file upload POST handler.
source

install-reconciler!clj/s

(install-reconciler! file-upload-networking reconciler)
source

progress%clj/s

(progress% progress-evt)

Namespace DEPRECATED. Given a XhrIo network progress event, returns a number between 0 and 100 to indicate progress.

Namespace DEPRECATED.
Given a XhrIo network progress event, returns a number between 0 and 100 to indicate progress.
sourceraw docstring

ui-fileclj/s

Render a file that is to be (or is in the process of being) uploaded.

Render a file that is to be (or is in the process of being) uploaded.
sourceraw docstring

ui-file-uploadclj/s

Namespace DEPRECATED.

Render a file upload component. Typically declared and embedded in a form. All of these parameters can be passed through f/form-field, which is the normal way to render this control when using forms.

Allowed customization props (through computed):

:accept - The MIME types (comma-separated string) allowed.

:multiple? - If the upload should let the user select multiple files.

:renderFile - A custom (fn [upload-id file-props] DOM) to render the files that selected for upload. upload-id is the ID of the file upload control that owns the file. See fulcro.ui.file-upload/File's query for details of available file-props. Can invoke the cancel-file-upload mutation to cancel an upload (which is why you need the upload-id).

:renderControl - A custom (fn [onChange accept multiple?] DOM) that will render the DOM for the control that appears to allow users to add files. Must output at least an input of type file with onChange set to the function it receives. If set, accept is the acceptable MIME types, and multiple? is if the control should allow more than one file to be selected. The upload input UI component will hide the control if it is not multiple and a file has been selected.

Namespace DEPRECATED.

Render a file upload component. Typically declared and embedded in a form. All of these parameters can
be passed through f/form-field, which is the normal way to render this control when using forms.

Allowed customization props (through computed):

:accept - The MIME types (comma-separated string) allowed.

:multiple? - If the upload should let the user select multiple files.

:renderFile - A custom `(fn [upload-id file-props] DOM)` to render the files that selected for upload.
`upload-id` is the ID of the file upload control that owns the file.
 See fulcro.ui.file-upload/File's query for details of available file-props. Can invoke
 the `cancel-file-upload` mutation to cancel an upload (which is why you need the upload-id).

:renderControl - A custom `(fn [onChange accept multiple?] DOM)` that will render the DOM for the control that appears to allow
users to add files. Must output at least an `input` of type `file` with onChange set to the function it
receives. If set, `accept` is the acceptable MIME types, and `multiple?` is if the control should allow more
than one file to be selected. The upload input UI component will hide the control if it is not multiple and
a file has been selected.
sourceraw docstring

wrap-file-uploadclj

(wrap-file-upload h upload)

Ring middleware. Place in your ring stack above wrap

(-> (wrap-file-upload upload-component) middleware/wrap-transit-params middleware/wrap-transit-response wrap-content-type wrap-params wrap-multipart-params)

You'll need to create (probably as a component) an upload component that implements the FileUpload protocol (shown as upload-component in the example).

Ring middleware. Place in your ring stack above wrap

(-> (wrap-file-upload upload-component)
    middleware/wrap-transit-params
    middleware/wrap-transit-response
    wrap-content-type
    wrap-params
    wrap-multipart-params)

You'll need to create (probably as a component) an upload component that
implements the FileUpload protocol (shown as `upload-component` in the example).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close