Dilan,
From the modeler the restriction is in MB's only. The value for the restriction is an int32 so the minimum is 1 Mb.
You can however let the user upload a file that is restricted to 1 Mb (as set in the modeler), then with a java action check the filesize after it has been uploaded and based on the maximum size that you want either accept the file or delete the file and return a message to the user.
For the java code just perform a Core.getFileDocumentContent this will return an InputStream.
In the Extra code section add something similar to the code below:
public static byte[] getBytes(InputStream is) throws IOException {
int len;
int size = 1024;
byte[] buf;
if (is instanceof ByteArrayInputStream) {
size = is.available();
buf = new byte[size];
len = is.read(buf, 0, size);
} else {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
buf = new byte[size];
while ((len = is.read(buf, 0, size)) != -1)
bos.write(buf, 0, len);
buf = bos.toByteArray();
}
return buf;
}
Call this method to get the bytearray returned, and then with the length method of the byte array determine the size
The length is returned in bytes so divide by 1024 to get your Kb size.
You could then return the size to your microflow and base decisions on the outcome.
Hope this helps in finding a solution for your challenge