How can i check file size before uploading it?
plz tell how to do that.
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/46e6f882-2491-40ae-9702-fe7f2d4ca886%40runmyprocess.com.
For more options, visit https://groups.google.com/a/runmyprocess.com/d/optout.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/CADHrCayeOmMDipt_W5e7VY5dZYcvFwujrEsjUcf24ce-ZSjkeQ%40mail.gmail.com.
I have done similar things before. This is how I would do it with javascript:
// This will check the size of all files and print it to the console
var checkUploadedFiles = function(event) {
var files = event.target.files;
for (var i = 0; i < files.length; i++) {
console.log(files[i].name + ": " + files[i].size + " bytes");
}
};
// Bind the size validation to the actual file upload element
var updateFileUploader = function(widget) {
var file_upload_element = document.getElementById(widget.getName());
file_upload_element.onchange = checkUploadedFiles;
};
// Find all file upload widgets that should be updated
var findUploaders = function(widgets) {
for (var i = 0; i < widgets.length; i++) {
if (widgets[i] != undefined) {
if (Array.isArray(widgets[i])) {
findUploaders(widgets[i]);
}
else if (widgets[i].getType() === "RMP_FileUpload") {
updateFileUploader(widgets[i]);
}
}
}
};
// Wait until the page has finished updating before starting to change things
var updateFileUploaderWhenLoaded = function() {
if (!RMPApplication.isValid()) {
setTimeout(updateFileUploaderWhenLoaded, 100);
} else {
findUploaders(RMPApplication.getAllWidgets());
}
};
// Start the process
updateFileUploaderWhenLoaded();
--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "Fujitsu RunMyProcess Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum+unsubscribe@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/cf1e6309-b664-441a-a4dc-72fd5072e021%40runmyprocess.com.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at https://groups.google.com/a/runmyprocess.com/group/supportforum/.