Jump to content

sk8er0i

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by sk8er0i

  1. the warning was copied from the previous post as just the general type of warning I get...here is exactly what is happening now. I have the the 2 php files in the same directory I'm trying to upload to and that directory has 777 permissions. So upload.php has the browse and send buttons and passes the data to the httpupload.php httpupload.php has the permissions error on line 9 that was shown in my previous post the error message with this configuration is: Warning: move_uploaded_file(/home/jdkistm/public_html/stichabrossite/catspjsgigs.txt): failed to open stream: Permission denied in /home/jdkistm/public_html/stichabrossite/httpupload.php on line 9 Warning: move_uploaded_file(): Unable to move '/tmp/phpQbpotH' to '/home/jdkistm/public_html/stichabrossite/catspjsgigs.txt' in /home/jdkistm/public_html/stichabrossite/httpupload.php on line 9 I'm puzzled... Thanks for looing at this!
  2. Target folder is 777 does this look right? ><?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/home/jdkistm/public_html/stichabrossite/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; ------------------------------------------------------------------------------------ if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { ------------------------------------------------------------------------------------ echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?> the isloated line by dashes in the code is what keeps giving me the permissions error in my previous post... >Warning: move_uploaded_file(/home/jdkistm/catspjsgigs.txt): failed to open stream: Permission denied in /home/jdkistm/public_html/httpupload.php on line 9 Warning: move_uploaded_file(): Unable to move '/tmp/phpLXwcAY' to '/home/jdkistm/catspjsgigs.txt' in /home/jdkistm/public_html/httpupload.php on line 9 Thanks again
  3. I have been trying to implement this http file upload and while testing I keep getting a permissions error... Warning: move_uploaded_file(/home/jdkistm/catspjsgigs.txt): failed to open stream: Permission denied in /home/jdkistm/public_html/httpupload.php on line 9 Warning: move_uploaded_file(): Unable to move '/tmp/phpLXwcAY' to '/home/jdkistm/catspjsgigs.txt' in /home/jdkistm/public_html/httpupload.php on line 9 Possible file upload attack! Here is some more debugging info:Array ( [userfile] => Array ( [name] => catspjsgigs.txt [type] => text/plain [tmp_name] => /tmp/phpLXwcAY [error] => 0 => 896 ) ) What do I need to put in the path for the tch server to play nice? Thanks for the help guys! -Jon
  4. So I have setup an FTP script to allow a user to upload a file via a web browser to my server. It all works and the file appears on the screen and in the directory on the server the only problem is that there isn't any actual data in the file. It appears to be there, but when you open it it's just a 0kb file with no text or anything. Any ideas? Here is my code...Thanks! >if ($_POST["action"] == "add") { // Get all the POST data $ftp_server='ftp.jonkinney.com';//serverip $conn_id = ftp_connect($ftp_server); // login with username and password $user="username"; $passwd="password"; $login_result = ftp_login($conn_id, $user, $passwd); // check connection if ((!$conn_id) || (!$login_result)) { header("Location: http://www.jonkinney.com/stichabrossite/managedownloads.php?error=FTP connection has failed!<br />Attempted to connect to $ftp_server for user $ftp_user_name"); die; } else { //directory switching if (downloadtype_id == "1"){ $directory = "mixes"; } else { $directory = "files"; } ftp_chdir($conn_id, "public_html/stichabrossite/downloads/$artistname/$directory"); $destination_file= "$filename"; // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { header("Location: http://www.jonkinney.com/stichabrossite/managedownloads.php?error=Upload has failed!"); } else { mysql_query("INSERT INTO Downloads (Title, Description, DownloadType_id , Filename, Artist) VALUES ('$title', '$description', '$downloadtype_id', '$filename', '$artistname')", $connection); header("Location: http://www.jonkinney.com/stichabrossite/managedownloads.php?error=Uploaded local file to $ftp_server as $destination_file"); } // close the FTP stream ftp_close($conn_id); }
×
×
  • Create New...