Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 838401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:17:57+00:00 2026-05-15T05:17:57+00:00

Using this upload script and it was working ok a week ago but when

  • 0

Using this upload script and it was working ok a week ago but when i checked it today it fails. I have checked writ privileges on the folder and it is set to 777 so don’t think that is the problem. Anyone have a idea of what the problem can be?

this is the error

Warning: move_uploaded_file() [function.move-uploaded-file]: 
Unable to access replays/1275389246.ruse in 
/usr/home/web/wno159003/systemio.net/ruse.systemio.net/scripts/upload.php on line 95

my script is

    <?php

   require($_SERVER['DOCUMENT_ROOT'].'/xxxx/xxxx');
   $connection = @mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
   mysql_select_db($db_name, $connection);

   $name = basename($_FILES['uploaded']['name']);
   $comment = $_POST["comment"];
   $len = strlen($comment);
   $username = $_POST["username"];
   $typekamp = $_POST["typekamp"];
   $date = time();


   $target = "replays/";
   $target .= basename($_FILES['uploaded']['name']);
   $maxsize = 20971520; // 20mb Maximum size of the uploaded file in bytes

// File extension control
// Whilelisting takes preference over blacklisting, so if there is anything in the whilelist, the blacklist _will_ be ignored
// Fill either array as you see fit - eg. Array("zip", "exe", "php")
$fileextensionwhitelist = Array("ruse"); // Whilelist (allow only)
$fileextensionblacklist = Array("zip", "exe", "php", "asp", "txt"); // Blacklist (deny)
$ok = 1;

if ($_FILES['uploaded']['error'] == 4)

{
   echo "<html><head><title>php</title></head>";
   echo '<body bgcolor="#413839" text="#ffffff">
   <p><B>info</b></p>';
   die("No file was uploaded");
}

if ($_FILES['uploaded']['error'] !== 0)
{
   echo "<html><head><title>php</title></head>";
   echo '<body bgcolor="#413839" text="#ffffff">
   <p><B>info</b></p>';
   die("An unexpected upload error has occured.");
}

// This is our size condition
if ($_FILES['uploaded']['size'] > $maxsize)
{
   echo "<html><head><title>php</title></head>";
   echo '<body bgcolor="#413839" text="#ffffff">
   <p><B>info</b></p>';
   echo "Your file is too large.<br />\n";
   $ok = 0;
}

// This is our limit file type condition
if ((!empty($fileextensionwhitelist) && !in_array(substr(strrchr($_FILES['uploaded']['name'], "."), 1), $fileextensionwhitelist)) || (empty($fileextensionwhitelist) && !empty($fileextensionblacklist) && in_array(substr(strrchr($_FILES['uploaded']['name'], "."), 1), $fileextensionblacklist)))
{
   echo "<html><head><title>php</title></head>";
   echo '<body bgcolor="#413839" text="#ffffff">
   <p><B>info</b></p>';
   echo "This type of file has been disallowed.<br />\n";
   $ok = 0;
}

// Here we check that $ok was not set to 0 by an error
if ($ok == 0)
{
   echo "<html><head><title>php</title></head>";
   echo '<body bgcolor="#413839" text="#ffffff">
   <p><B>info</b></p>';
   echo "Sorry, your file was not uploaded. Refer to the errors above.";
}

// If everything is ok we try to upload it
else
{
   if($len > 0)
    {      
       $target = "replays/".time().'.'."ruse";
      $name = time().'.'."ruse";
      $query = "INSERT INTO RR_upload(ID, filename, username, comment, typekamp, date) VALUES (NULL, '$name', '$username','$comment', '$typekamp' ,'$date')";

      if (file_exists($target))
      {
         $target .= "_".time().'.'."ruse";
         echo "<html><head><title>php</title></head>";
         echo '<body bgcolor="#413839" text="#ffffff">
         <p><B>info</b></p>';
         echo "File already exists, will be uploaded as ".$target;
      }

      mysql_query($query, $connection) or die (mysql_error());

      echo "<html><head><title>php</title></head>";
      echo '<body bgcolor="#413839" text="#ffffff">
      <p><B>info</b></p>';
      echo (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))

      ? "The file ".basename( $_FILES['uploaded']['name'])." has been uploaded. \n"
      : "Sorry, there was a problem uploading your file. <br>";
      echo "<br>Variable filename: ".$name;
      echo "<br>Variable name: ".$username;
      echo "<br>Variables comment: ".$comment;
      echo "<br>Variables date: ".$date;
      echo "<br>Var typekamp; ".$typekamp;
      echo "<br>Var target; ".$target;
      }
   else
   {
      echo "<html><head><title>php</title></head>";
      echo '<body bgcolor="#413839" text="#ffffff">
      <p><B>info</b></p>';
      echo"you have to put in comment/description";
   }

}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:17:57+00:00Added an answer on May 15, 2026 at 5:17 am

    Assuming the “replays” directory is in the document root, does the warning persists if you replace this line :

    $target = "replays/";
    

    by this one :

    $target = $_SERVER['DOCUMENT_ROOT']."replays/";
    

    ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an image upload script and ran into this problem. Using
I need to upload a given image using Amazon S3 I have this PHP:
I am using plupload ( http://www.plupload.com ) script and it's working ok but it
I have PHP page where users can upload photos (using Ajax & PHP script).
I am creating an upload script for images and have a working script although
I am currently working with multiple php image uploading but using this SITE I
I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
i am making an upload with Ajaxupload plugin and i am using this function
I am trying to upload my app's updates via Xcode to itunesconnect using this
I got this traceback when trying to upload a file using put_file (source code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.