Jump to content

emmerac

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

emmerac's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, so I got the upload to work, but then after a few successful trial runs I started getting error 6 telling me that my tmp directory is not setup in my php.ini, but when I check my php.ini I see that I have it set to a /tmp folder in the /xamppfiles directory. What the heck is going on here?
  2. I switched over to XAMPP and I am still getting the same error from the same code: Warning: file_get_contents(money.gif) [function.file-get-contents]: failed to open stream: No such file or directory in /Applications/xampp/xamppfiles/htdocs/geezum/s3up.php on line 16 Failed to read file money.gif I have chmod to 777 the upload directory. When I test it out I am simply trying to upload a small .gif that is sitting on my desktop and I get that error. Any idea's?
  3. Hi all, I'm a complete newb and I am getting really frustrated. I am running the PHP that ships with Leopard. I am using some basic PHP code to upload a file but it will only accept files from the same directory as the .php code, so if I try to upload a file from another computer to the server I get an file does not exist error! <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.