5.15.0
If you pass a large Blob
that was created using JavaScript in the browser into addFiles
, you should consider calling the removeFileRef
method after the file has been successfully uploaded to free up any memory consumed by the Blob.
Submit one or more files to the uploader.
A BlobWrapper
object:
Property | Description |
---|---|
blob | the bytes of the Blob object being uploaded |
name | the name of the Blob |
A CanvasWrapper
object:
Property | Description |
---|---|
canvas | the <canvas> to be converted to a file & then uploaded |
name | the name to assign to the created file |
quality | 1-100 value indicating the desired quality of the converted file (only for image/jpeg) |
type | MIME type of the file to create from this <canvas> |
An array of File
s, <input>
s, Blob
s, BlobWrapper
objects, <canvas>
es, or CanvasWrapper
objects. You may also pass in a FileList
.
A set of parameters to send with the file to be added
The endpoint to send this file to
Submit one or more canned/initial files to the uploader. See the Initial File List feature page for more details.
An array of objects that describe files already on the server.
Cancel the queued or currently uploading item which corresponds to the id
.
The file's id
Cancels all queued or currently uploading items.
Clears the internal list of stored items. Only applies when autoUpload
is false
Attempts to continue a paused upload.
A file id
Send a delete request to the server for the corresponding file id.
Draws a thumbnail.
The id of the image file.
The element where the image preview will be drawn. Must be either an <img>
or <canvas>
element.
The maximum dimensions (for width and height) you will allow this image to scale to.
true
if the image data will come as a response from the server rather than be generated client-side.
Ignored if the current browser does not support image previews. If you want to use an alternate library to resize the image, you must contribute a function for this option that returns a Promise
. Once the resize is complete, your promise must be fulfilled. You may, of course, reject your returned Promise
is the resize fails in some way.
A resizeInfo
object, which will be passed to the supplied function, contains the following properties:
blob
- The original File
or Blob
object, if available.height
- Desired height of the image after the resize operation.image
- The original HTMLImageElement
object, if available.sourceCanvas
- HTMLCanvasElement
element containing the original image data (not resized).targetCanvas
- HTMLCanvasElement
element containing the HTMLCanvasElement
that should contain the resized image.width
- Desired width of the image after the resize operation.Returns the button container element associated with a file
The file id
Returns the file identified by the id. File API browsers only.
The file id.
Returns the endpoint associated with a particular file, or the current catch-all endpoint for all files (if no ID is specified).
The ID of the associated file.
Returns the number of items that are either currently uploading or waiting for an available connection (qq.status.QUEUED
). If called inside of a cancel
event handler, then this method will return a value that includes the upload associated with the cancel
event handler. This is because the upload will not be canceled until the event handler returns.
Returns the name of the file with the associated id.
The file id
Get the number of items that have been successfully uploaded and have not been deleted.
Get the ID of the parent file for this scaled file.
The ID of a scaled image file
Returns the numer of remaining allowed items that may be submitted for upload based on validation.itemLimit
.
Returns an array of potentially resumable items. Each resumable is represented by an object with the following properties:
Property | Description |
---|---|
name |
filename |
uuid |
the unique id |
partIdx |
the index of the part where the resume will start from |
Returns the size of the item with the associated id.
The file id.
Return information about all the items that have been submitted to the uploader. The objects being iterated over will have the following properties: id
, uuid
, originalName
, name
, status
, and size
. For information on filtering via the filter parameter, see the upload status feature page.
An object which indicates which keys and values must be present in an upload to be returned.
Returns the UUID of the item with the associated id.
The fild id.
Output a message to the console, if possible.
The message to print
The level to output the message at.
Attempts to pause an in-progress upload.
The file id.
Remove internal reference to the associated Blob/File object. For Blobs that are created via JavaScript in the browser, this will free up all consumed memory.
Reset Fine Uploader
Attempt to upload a specific item again.
The file id.
Generates a scaled version of a submitted image file.
The id of the image file.
Information about the scaled image to generate. The following properties are supported:
maxSize
(required) (integer).orient
(boolean, defaults to true)type
(string, defaults to the type of the reference image)quality
(number between 0 and 100, defaults to 80)includeExif
(boolean, defaults to false
).customResizer
(function) - Ignored if the current browser does not support image previews. If you want to use an alternate library to resize the image, you must contribute a function for this option that returns a Promise
. Once the resize is complete, your promise must be fulfilled. You may, of course, reject your returned Promise
is the resize fails in some way.A resizeInfo
object, which will be passed to your (optional) customResizer
function, contains the following properties:
blob
- The original File
or Blob
object, if available.height
- Desired height of the image after the resize operation.image
- The original HTMLImageElement
object, if available.sourceCanvas
- HTMLCanvasElement
element containing the original image data (not resized).targetCanvas
- HTMLCanvasElement
element containing the HTMLCanvasElement
that should contain the resized image.width
- Desired width of the image after the resize operation.Set custom headers for an upload request. Pass in a file id to make the headers specific to that file.
The custom headers to include in the upload request. Fine Uploader may also send some other required headers.
The file id.
Modify the location where upload requests should be directed. Pass in a file id to change the endpoint for that specific item.
A valid URI where upload requests will be sent.
An integer corresponding to a file.
Set custom headers for a delete file request. Pass in a file id to make the headers specific to that file.
The custom headers to include in the delete request. Fine Uploader may also send some other required headers.
The file id.
Modify the location where delete requests should be directed. Pass in a file id to change the endpoint for that specific item.
A valid URI where delete requests will be sent.
An integer corresponding to a file.
Set the parameters for a delete request. Pass in a file id to make the parameters specific to that file.
The parameters to include in the delete request.
The file id.
Change the validation.itemLimit
option set during construction/initialization.
The new file count limit.
Bind a <form>
to Fine Uploader dynamically. See the form support feature page for more details.
A form element or a form element's ID.
Change the name of a file.
The file id.
The new file name.
Set the parameters for an upload request. Pass in a file id to make the parameters specific to that file.
The parameters to include in the upload request.
The file id.
Change the UUID of a file.
The file id.
The new file UUID.
Modify the status of an file.
The status values correspond to those found in the qq.status
object. Currently, the following status values may be set via this method:
qq.status.DELETED
qq.status.DELETE_FAILED
The file id.
The new qq.status
value.
Begin uploading all queued items. Throws a NoFilesError
of there are no items to upload.
Mark element
as a drop zone.
The element to mark as a drop zone.
Returns the (drop zone) element where the file was dropped. Undefined if drop event was not involved.
The id of a file.
Returns the file id
associated with an HTMLElement
.
Returns the ID of the associated file, given a file container element or a child of a file container element.
Returns the HTMLElement
associated with the file id.
The file id.
Used to un-mark an element
as a drop zone.
The element to un-mark as a drop zone.