Hello,
When trying to test my uploader script I get the following error:
Warning: copy(http://www.brianbourdon.net/phptt_4b/uploads/test.txt): failed to open stream: HTTP wrapper does not support writeable connections.
in /var/www/html/phptt_4b/doadd.php on line 49
I honestly cannot figure out the error. Here is the code:
if($upload != "") {
$tmp_name = $_FILES['upload']['tmp_name'];
$new_name = $_FILES['upload']['name'];
$type = $_FILES['upload']['type'];
$size = $_FILES['upload']['size'];
if(in_array($type, $filetypes)) {
if($size < $max_filesize) {
copy($upload, $upload_dir . "/" . $new_name);
$uploaded_to = "$upload_dir/$new_name";
$sql = "INSERT INTO `$tickets` SET board_id = '$bid', title = '$ttitle', body = '$tbody', upload = '$uploaded_to', priority = '3', user = '$user_name', timestamp = '$dateandtime', status = 'open'";
$add = mysql_query($sql, $conn);
alert_goto("$lng_addedticket", "$scripts/main.php");
} else {
error_msg("$lng_filetobig");
}
} else {
error_msg("$lng_fileinvalidtype");
}
I have also tried to use the move_uploaded_file(); function but that produces the same error. I am allowing the txt file type to be uploaded through my "allowed" extensions array (i think, i have this allowed: text/plain). I am allowing GIF images to and the provide the same error.
Thanks for any help!
Brian