-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimageUpload.php
More file actions
41 lines (30 loc) · 781 Bytes
/
Copy pathimageUpload.php
File metadata and controls
41 lines (30 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once "imageUpload.class.php";
if ( $_POST && $_FILES){
$Upload = new UploadImagem();
if ( isset( $_POST["uploadFolder"] ) ){
$Upload->uploadDir = $_POST["uploadFolder"];
}
if ( isset( $_FILES["imageUpload"] ) ){
$Upload->file = $_FILES['imageUpload'];
}
if ( isset( $_POST["resizeTo"] ) ){
$Upload->resize = $_POST['resizeTo'];
}
if ( isset( $_POST["renameTo"] ) ){
$Upload->name = $_POST['renameTo'];
}
if ( isset( $_POST["cropCoordinates"] ) ){
$Upload->crop = $_POST['cropCoordinates'];
}
if ( isset( $_POST["convertTo"] ) ){
$Upload->convertTo = $_POST['convertTo'];
}
try{
$Upload->upload();
header('HTTP/1.0 200 OK');
}catch(exception $e){
echo $e->getMessage();
header('HTTP/1.1 500 Internal Server Error');
}
}