Skip to end of metadata
Go to start of metadata

Refresh page Mar 13, 2020 02:33

Supported Clients
SmartClient WebClient NGClient

Methods Summary
Array getBytes() This returns the bytes of the uploaded file, try to using streaming or file operation on it (so the bytes don't have to be full loaded in to memory)
String getContentType()
String getFieldValue(name) Returns the value for a give form field that was give as metadata to this uploaded file
Array getFields() This returns the field names of the form fields that where give as metadata to this upload file.
String getName()
Number getSize()
String getString() Returns the contents of the file as as string in UTF-8 encoding.
Boolean isInMemory() If this returns false, then a tmp file is created for it.
Boolean write(file) Writes the contents of this upload right to a file.

Methods Details

getBytes()

This returns the bytes of the uploaded file, try to using streaming or file operation on it (so the bytes don't have to be full loaded in to memory)

Returns

Array the bytes of the upload file,

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getContentType()

Returns

String the content type of this upload

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getFieldValue(name)

Returns the value for a give form field that was give as metadata to this uploaded file

Parameters

String name The form fields name

Returns

String the value that was given or null

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getFields()

This returns the field names of the form fields that where give as metadata to this upload file.

Returns

Array String[] Array of names of the field names

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getName()

Returns

String the name of the upload file.

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getSize()

Returns

Number the size of the upload

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getString()

Returns the contents of the file as as string in UTF-8 encoding.

Returns

String the String contents

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

isInMemory()

If this returns false, then a tmp file is created for it. This means that you can also convert this to a JSFile and call rename() on it.
But the method write(file) will always work by writing the contents of this upload file to a different file.

Returns

Boolean true if this upload is fully in memory (not saved to a temp file)

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

write(file)

Writes the contents of this upload right to a file. Use the file plugin to create a JSFile object that can be given to this function.
If this file was not fully in memory (isInMemory == false) then this will just stream the tmp file to the give file.

Parameters

Object file the file object where to write to can be a JSFile or path string

Returns

Boolean if write could be done

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

  • No labels