platkonijn
08-25-2004, 12:32 PM
I have an php upload script.
But I want also that the uploade file will be resized to a width of 400 px and the height automaticly scales with it.
But how can I integrate it ?
WHo can help me !
Script:
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = "d:/ensimdata/anne-marie/Inetpub/wwwroot/img/"; // IIS kan niet om met relatieve paden, en heeft een absoluut pad op de server nodig
$uploadfile = "d:/ensimdata/anne-marie/Inetpub/wwwroot/img/". $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
}
else {
print "Possible file upload attack!* Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
But I want also that the uploade file will be resized to a width of 400 px and the height automaticly scales with it.
But how can I integrate it ?
WHo can help me !
Script:
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = "d:/ensimdata/anne-marie/Inetpub/wwwroot/img/"; // IIS kan niet om met relatieve paden, en heeft een absoluut pad op de server nodig
$uploadfile = "d:/ensimdata/anne-marie/Inetpub/wwwroot/img/". $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
}
else {
print "Possible file upload attack!* Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>