forum.coppermine-gallery.net
Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: mahdi1234 on May 27, 2009, 07:20:44 pm
-
hi there,
First off - I've read many threads on this and I've checked with my provider on whether temp folder is writable, so please read my post first before pointing me to other topics here.
site: http://testing2.fotoluzr.net/
user: test
password: test
albums; albums\edit; albums\userpics folders all set to 777.
file_uploads On On
upload_tmp_dir /DISK2/TMP /DISK2/TMP
post_max_size 8M 8M
debug mode enabled for user.
I've also created small script
<html>
<body>
<form action="upload.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
<?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"],
"" . $_FILES["file"]["name"]);
echo "Stored in: " . "" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
?>
which successfully uploads a file, so temp folder is really writable.
Upload: JAlbum.jpg
Type: image/jpeg
Size: 0.0625 Kb
Temp file: /DISK2/TMP/phpeoTNvF
Stored in: JAlbum.jpg
Would you have any other suggestion on what to check?
thanks,
mahdi
-
An update on this.
Tried with 1.4.22 and it works - it got broken for me with .23 and still the same with .24 (just did fresh install of .22 and .24 with IDENTICAL settings).
Would any of developers had clue what could have made this problem between .22 vs .23/24? I'd like to avoid downgrading to unprotected version.
Thanks.
-
Will be fixed in the next release. For now you can edit include/init.inc.php, find
$keysToSkip = array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', 'HTML_SUBST', 'keysToSkip', 'register_globals_flag', 'cpgdebugger', 'key');
change to
$keysToSkip = array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_FILES', 'HTML_SUBST', 'keysToSkip', 'register_globals_flag', 'cpgdebugger', 'key');
-
Thanks a lot Nibbler :)
-
Fixed it for me too.
Thanks.
-
Thank you very much ;)
-
Locked