function handleFileUpload(files) {
    const file = files[0];

    const fileSize = file.size;
    const mimeArray = file.type.split("/");
    const fileType = mimeArray[0];


    if (fileType !== "image") {
        console.log("Error file type = " + fileType);
        fileValid = false;
        return;
    };

    // 250MB
    const fileSizeLimit = 262144000;
    if (fileSize > fileSizeLimit) {
        console.log("Error file size = " + fileSize);
        fileValid = false;
        return;
    };

    fileValid = true;

    return fileValid;
}
// Validating the upload file for the upload of the pictures.

Validating the upload file for the upload of the pictures.
Validating the upload file for the upload of the pictures .
function handleFileUpload(files) {
    const file = files[0];
    const fileSize = file.size;
    const mimeArray = file.type.split("/");
    const fileType = mimeArray[0];
    if (fileType !== "image") {
        console.log("Error file type = " + fileType);
        fileValid = false;
        return;
    };
    const fileSizeLimit = 262144000;
    if (fileSize > fileSizeLimit) {
        console.log("Error file size = " + fileSize);
        fileValid = false;
        return;
    };
    fileValid = true;
    return fileValid;
}
function handleFileUpload ( files ) { const file = files [ 0 ] ; const fileSize = file . size ; const mimeArray = file . type . split ( "/" ) ; const fileType = mimeArray [ 0 ] ; if ( fileType !== "image" ) { console . log ( "Error file type = " + fileType ) ; fileValid = false ; return ; } ; const fileSizeLimit = 262144000 ; if ( fileSize > fileSizeLimit ) { console . log ( "Error file size = " + fileSize ) ; fileValid = false ; return ; } ; fileValid = true ; return fileValid ; }
Validating the upload file for the upload of the pictures.
Validating the upload file for the upload of the pictures .
// 250MB
