servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Methods SummaryvoidDelets this uploaded file so it will be cleaned up if it was streamed in a temp file.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 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 DetailsdeleteFilename
deleteFile()
dessIndent
Delets this uploaded file so it will be cleaned up if it was streamed in a temp file.
The system tries to clean this up for you, but that can take a while and depends on Garbage Collection.
So it is better to be explicit and delete this file.
if you use JSUpload.write(file) then the file is very likely moved instead of copied so the temp file is also removed.
clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetBytesname
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,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetContentTypename
getContentType()
dessIndentret
Returns
sIndent the content type of this uploadclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetFieldValuename
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 nameret
Returns
sIndent the value that was given or nullclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetFieldsname
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 namesclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetNamename
getName()
dessIndentret
Returns
sIndent the name of the upload file.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetSizename
getSize()
dessIndentret
Returns
sIndent the size of the uploadclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetStringname
getString()
dessIndent
Returns the contents of the file as as string in UTF-8 encoding.
ret
Returns
sIndent the String contentsclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowisInMemoryname
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,NGClientsam
Sample
sIdentjavascriptlastDetailRowwritename
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.
If it was a temp file then it will try to move the file to the given location (so temp file is moved and because of that already deleted/cleaned up).
prs
Parameters
sIndentfilethe file object where to write to can be a JSFile or path stringret