Hi!
I am calling the script below using
upload.php?filename=d:\files\myfile.zip
but it doesn't seem to work. The local file exists and the destination folder has all the correct permissions set. Is there any
reason why I shouldn't be able to pass the
filename of the file I want to upload in this
way? Even if I set $filename to the local filename within the script, it still doesn't seem to work.
Help!
<?php
$my_max_file_size = "307200"; # in bytes
$image_max_width = "300";
$image_max_height = "300";
$the_path = "../jls2/uploads";
function upload($the_file) {
global $the_path,$the_file_name;
if (!@copy($the_file, $the_path . "/" . $the_file_name)) {
print "\n<P><b>ERROR</b>";
} else {
print "\n<P><b>OK</b>";
}
} # END upload
print "\n<head>\n<title>Upload File</title>\n</head>\n<body>";
upload($filename);
print "\n</body>\n";
?>