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 6337695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:17:56+00:00 2026-05-24T19:17:56+00:00

This script hasn’t changed since yesterday when it was working and I used it

  • 0

This script hasn’t changed since yesterday when it was working and I used it to upload things to my server now it is giving me errors.

The script:

<script>
$(document).ready(function(){
$.ajax({
  type: 'GET',
  url: '../units_and_evidence/"',
  data: 'cache=yes'
});
});
</script>
<?php
include($_SERVER['DOCUMENT_ROOT']."/dbconnect.php");
$filetype = $_POST["filetype"];
$file= $_FILES["file"]["name"];
$extension = strtoupper(strrchr($file, "."));
$filename = substr($file, 0, -strlen($extension));
$unitID = $_POST["units"];
$projectID = $_POST["project"];
$title = $_POST["title"];
$projectString = strtolower(str_replace(" ", "", $_POST["projectString"]));
$target_path = '../units_and_evidence/files/'.$projectString.'/'. basename( $_FILES['file']['name']);
$outcomes = implode(',', $_POST["outcomes"]);
if(is_uploaded_file($_FILES['source']['tmp_name'])) {
$source_path = '../units_and_evidence/files/'.$projectString.'/'.$filename.'.fla';
move_uploaded_file($_FILES['source']['tmp_name'], $source_path) or die("Couldn't upload source file");
}
if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
mysql_select_db('reithg_FILES');
if ($filetype == "PDF") {
$page = $_POST["page"];
$mode = $_POST["mode"];
mysql_query("INSERT INTO PDF (ID, UNITID, PROJECTID, OUTCOMES, TITLE, FILENAME, PAGE, MODE, FILETYPE) VALUES('NULL', '$unitID', '$projectID', '$outcomes', '$title', '$filename', '$page', '$mode', '$filetype') ") or die(mysql_error());  
}
else if ($filetype == "IMG") {
mysql_query("INSERT INTO IMG (ID, UNITID, PROJECTID, OUTCOMES, TITLE, FILENAME, EXTENSION, FILETYPE) VALUES('NULL', '$unitID', '$projectID', '$outcomes', '$title', '$filename', '$extension', '$filetype') ") or die(mysql_error());  
}
else if ($filetype == "FLASH") {         
mysql_query("INSERT INTO FLASH (ID, UNITID, PROJECTID, OUTCOMES, TITLE, FILENAME, FILETYPE) VALUES('NULL', '$unitID', '$projectID', '$outcomes', '$title', '$filename', '$filetype') ") or die(mysql_error());  
}
header('Location: upload_file.php?success=true');
} else{
header('Location: upload_file.php?success=false');
}
?>

The error:

Warning: move_uploaded_file(../units_and_evidence/files/ report /eHealth evaluation_Final.pdf) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/reithg/public_html/admin/process.php on line 17

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpPcxZxC' to '../units_and_evidence/files/ report /eHealth evaluation_Final.pdf' in /home/reithg/public_html/admin/process.php on line 17

As you can see it is adding whitespaces around the word report. report comes from $projectString and not only does it not have whitespaces in originally I also strip them out of it for safety.

  • 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-24T19:17:57+00:00Added an answer on May 24, 2026 at 7:17 pm

    Maybe they are tabs and not spaces. Use trim instead. http://php.net/manual/en/function.trim.php, honestly thats all i can say as i don’t see any other helpful code posted.

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

Sidebar

Related Questions

I am seeing both of them used in this script I am trying to
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
I'm using this script to display all the images in a folder, but I
Well basically I have this script that takes a long time to execute and
I am writing a script for MS PowerShell. This script uses the Copy-Item command.
I'm trying to write a python script that packages our software. This script needs
I am using C# and a console app and I am using this script
I have this Perl script with many defined constants of configuration files. For example:
So I wrote this short script (correct word?) to download the comic images from
I have this little script to toggle a contact form when a button is

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.