DEPRECATED: See the external file upload demo instead.
DEPRECATED: See the external file upload demo instead.
(abort-send this id)
Abort the send with the given ID.
Abort the send with the given ID.
(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.
(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.
(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.
(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)
(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)
(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.
(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.
(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? 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)
(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.
(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-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.
(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.
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.
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.
(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).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close