// SETTINGS //
$dirUploads = "files/"; // The directory the files will be uploaded to
$showDir = "yes";
$numUploads = "10"; // Number of upload blanks to be shown on page
$limitFiles = "yes"; // Allow only certain filetypes?
$showAllowedFiles = "yes"; //
$allowedFiles = array("jpg", "swf"); // Allowed filetypes
$mainTableWidth = "75%";
$stylesheet = "uploader_style.css";
$showCopyright = "yes"; // not required, but the script IS FREE
$reqSecure = "yes"; // Passcode control?
$userPassword = "2355";
// Screen Text & Error Messages - can be changed to any language
$caption = "MULTIFILE UPLOADER";
$loginpageMsg = "A Passcode Is Required";
$uploadpageMsg = "Select The Files To Upload";
$passwordText = "Passcode :";
$loginButtonText = "Go To Upload Page";
$logoutText = "logout now";
$allowedfiletypesText = "Allowed Filetypes";
$lineText = "File";
$uploadButtonText = "Upload Files";
$statusText = "Upload Status :";
$nofileText = "No file selected for upload";
$notallowedText = "NOT ALLOWED";
$existsText = "ALREADY EXISTS";
$successText = "has been uploaded";
// END OF SETTINGS //
what is happening there, the move_uploaded_file function is called, passing two arguments: first a string with the path to the temporary uploaded file (which is held by the variable $upFile3). The second argument is a string, with the path to the final destination of the uploaded file, which is built from a path to the final directory (held by the variable $dirUploads) and a filename (held by the variable $upFile1).
That part of code:
which we car re-write, for clarity, in another style:
$dirUploads . '/' . $upFile1
Did you see that? Yes! WE are adding a slash there! But maybe the slash has been already added in the directory path (which is a pretty common mistake), which is held by $dirUploads. In that case we would get two consequent slashes!!!!
Yey! Got it.
Now you can either choose to cut out that slash right there on line 116, by replacing it with this:
or (reccomended choise), you can correct your directory path declaration, which is at line 12, with this:
$dirUploads = "files"; // The directory the files will be uploaded to
Usually all the information you need is right there! And it's pretty straightforward.
Other times it's just a matter of back-solving problems, one step at a time.
Obviously this is more difficult when you inherited a script rather than coded it yourself, because you don't have a clear layout of the procedure in your mind, so you have to go fishing...
Hope this helps!
Altruism does not exist. Sustainability must be made profitable.