new HttpServerFileUpload()
Represents an file upload from an HTML FORM.
Methods
charset() → {string}
Returns:
the charset for the upload
- Type
- string
contentTransferEncoding() → {string}
Returns:
the contentTransferEncoding for the upload
- Type
- string
contentType() → {string}
Returns:
the content type for the upload
- Type
- string
endHandler(endHandler) → {HttpServerFileUpload}
Parameters:
| Name | Type | Description |
|---|---|---|
endHandler |
function |
Returns:
- Type
- HttpServerFileUpload
exceptionHandler(handler) → {HttpServerFileUpload}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
Returns:
- Type
- HttpServerFileUpload
fetch(amount) → {HttpServerFileUpload}
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number |
Returns:
- Type
- HttpServerFileUpload
file() → {AsyncFile}
Returns:
the async uploaded file when HttpServerFileUpload#streamToFileSystem has been used
- Type
- AsyncFile
filename() → {string}
Returns:
the filename which was used when upload the file.
- Type
- string
handler(handler) → {HttpServerFileUpload}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
Returns:
- Type
- HttpServerFileUpload
isSizeAvailable() → {boolean}
Returns:
true if the size of the upload can be retrieved via HttpServerFileUpload#size.
- Type
- boolean
name() → {string}
Returns:
the name of the attribute
- Type
- string
pause() → {HttpServerFileUpload}
Returns:
- Type
- HttpServerFileUpload
pipe() → {Pipe}
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a
WriteStream.
Returns:
a pipe
- Type
- Pipe
pipeTo(dst, handler)
Pipe this
ReadStream to the WriteStream.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler will be
called with the result.
Parameters:
| Name | Type | Description |
|---|---|---|
dst |
WriteStream | the destination write stream |
handler |
function |
resume() → {HttpServerFileUpload}
Returns:
- Type
- HttpServerFileUpload
size() → {number}
The size of the upload may not be available until it is all read.
Check HttpServerFileUpload#isSizeAvailable to determine this
Returns:
the size of the upload (in bytes)
- Type
- number
streamToFileSystem(filename) → {HttpServerFileUpload}
Stream the content of this upload to the given file on storage.
Parameters:
| Name | Type | Description |
|---|---|---|
filename |
string | the name of the file |
Returns:
- Type
- HttpServerFileUpload