Upload image /resizer
Door Eris -, 23 jaar geleden, 9.811x bekeken
$tempfile = link naar upload dir
$dir = doel dir
$file = nieuwe bestands naam
$height / $width maximale hoogte/breedte
Om het aan te roepen.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
include('imagehandler.php');
if(!empty($_FILES['file'])){
$error = upload($_FILES['file']['tmp_name'],'images/',$_FILES['file']['name'],800,800);
if($error[0] == true){
echo 'Upload is gelukt';
}else{
echo 'Error: '.$error[2];
}
}else{
echo '
<form enctype="multipart/form-data" method="post" action="upload.php">
<table border="0"><tr><td>File:</td><td><input type="file" name="file" /></td></tr>
<tr><td> </td><td><input type="submit" value="Upload" /></td></tr>
</table>
</form>';
}
?>
include('imagehandler.php');
if(!empty($_FILES['file'])){
$error = upload($_FILES['file']['tmp_name'],'images/',$_FILES['file']['name'],800,800);
if($error[0] == true){
echo 'Upload is gelukt';
}else{
echo 'Error: '.$error[2];
}
}else{
echo '
<form enctype="multipart/form-data" method="post" action="upload.php">
<table border="0"><tr><td>File:</td><td><input type="file" name="file" /></td></tr>
<tr><td> </td><td><input type="submit" value="Upload" /></td></tr>
</table>
</form>';
}
?>
Gesponsorde koppelingen
PHP script bestanden
Er zijn 24 reacties op 'Upload image resizer'
Om te reageren heb je een account nodig en je moet ingelogd zijn.
PHP hulp
0 seconden vanaf nu