hi there i have tried everything on the server that im uploading to.....
say that i am implementing a site with an upload script and all the files for upload goes to :
http://phpbuilder.com/upload
or
www/upload
right...., for that folder ive set permissions to 777
and its still telling me "cannot stream data", but its actually sending the information of titletype, and filename to the database.
here is the code
<html>
<head>
<title>Upload and log Files To Server</title>
</head>
<body>
<?php
$uploadpath = "/www/upload";
function upload($filename, $filename_name, $uploadpath, $title){
$dbname= "test";
$dbhost= "localhost";
$dbusername = "root";
$dbpassword = "pwd";
$dbtable = "upload";
copy($filename,$uploadpath."/".$filename_name);
$database = mysql_connect($dbhost, $dbusername, $dbpassword) or die ("ERROR Cant connect to MySQL");
mysql_select_db($dbname, $database) or die("ERROR Cant connect to database");
$query = "INSERT INTO " . $dbtable . " (id, titleType, fileName) VALUES (NULL,'$title','$filename_name')";
mysql_query($query);
mysql_close($database);
echo "$title";
echo "<p>Has been Uploaded!</p>";
echo "<a href=\"index.php\">Upload another file?</a>";
}
function form(){?>
<form name= "form1"form method="post"action="<?=$_SERVER['PHP_SELF']?>"enctype="multipart/form-data">
<p>
<input type="file" name="filename"></p><p>
<input type="text" name="title">
<strong>Title</strong></p><p>
<input name="Submit" type="submit" id="Submit" value="Upload">
<input type="hidden" name="formaction" value="uploadNow">
<input name="reset" type="reset" id="reset" value="Clear">
</p>
</form><?php }
switch ($formaction){
default:
form();
break;
case "uploadNow":
if ($filename=="none") {
echo("*** No information given! ***");}
else{
upload($filename, $filename_name, $uploadpath, $title);
break;}
break;
}
?>
</body>
</html>
😕 😕
the file never makes to the folder in the server ..... why why!!!
but one time, it didnt chuck that error "file stream error" it refresehed it self, but no data has been sent at all....
thanks guys