Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Client-side image processing with HTML
For client-side processing and uploading, you can try to run the following code −
<?php
if (isset($_FILES["image"])) {
$ iSize = getimagesize($_FILES["image"]["tmp_name"]);
if ($iSize!== false) {
$myFile = "/tmp/" . basename($_FILES["image"]["name"]);
if (move_uploaded_file($_FILES["image"]["tmp_name"], $myFile)) {
echo "File stored at " . $myFile;
} else {
echo "Image storage failed!";
}
} else {
echo "This isn’t an image!";
}
} else {
echo "Image not available to upload!";
}
?> Advertisements
