In this Web Driver IO tutorial, we’ll learn how to automate file uploads.
We’ll start by creating a simple HTML form that allows users to select a file to upload.
Next, we’ll create a PHP script that handles the file upload.
500000) {
echo “Sorry, your file is too large.”;
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != “jpg” && $imageFileType != “png” && $imageFileType != “jpeg”
&& $imageFileType != “gif” ) {
echo “Sorry, only JPG, JPEG, PNG & GIF files are allowed.”;
$uploadOk