Child pages
  • JSUpload

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryThis 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 the value for a give form field that was give as metadata to this uploaded fileThis returns the field names of the form fields that where give as metadata to this upload file.Returns the contents of the file as as string in UTF-8 encoding.If this returns false, then a tmp file is created for it.Writes the contents of this upload right to a file.

functionservoy sDetail2100%height:30px2Methods DetailsgetBytesname

getBytes()

dessIndent
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)
ret

Returns

sIndent the bytes of the upload file,
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetContentTypename

getContentType()

dessIndentret

Returns

sIndent the content type of this upload
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getFieldValuename

getFieldValue(name)

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

Parameters

sIndentnameThe form fields name
ret

Returns

sIndent the value that was given or null
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getFieldsname

getFields()

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

Returns

sIndent String[] Array of names of the field names
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getNamename

getName()

dessIndentret

Returns

sIndent the name of the upload file.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getSizename

getSize()

dessIndentret

Returns

sIndent the size of the upload
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getStringname

getString()

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

Returns

sIndent the String contents
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isInMemoryname

isInMemory()

dessIndent
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.
ret

Returns

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

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
writename

write(file)

dessIndent
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.
prs

Parameters

sIndentfilethe file object where to write to can be a JSFile or path string
ret

Returns

sIndent if write could be done
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow