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

Title: "No file was uploaded !" - db_input.php - Line: 311
Post 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

Code: [Select]
<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.

Code: [Select]
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
Title: Re: "No file was uploaded !" - db_input.php - Line: 311
Post by: mahdi1234 on May 27, 2009, 09:07:55 pm
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.
Title: Re: "No file was uploaded !" - db_input.php - Line: 311
Post by: Nibbler on May 27, 2009, 09:29:50 pm
Will be fixed in the next release. For now you can edit include/init.inc.php, find

Code: [Select]
$keysToSkip = array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', 'HTML_SUBST', 'keysToSkip', 'register_globals_flag', 'cpgdebugger', 'key');

change to

Code: [Select]
$keysToSkip = array('_POST', '_GET', '_COOKIE', '_REQUEST', '_SERVER', '_FILES', 'HTML_SUBST', 'keysToSkip', 'register_globals_flag', 'cpgdebugger', 'key');
Title: Re: "No file was uploaded !" - db_input.php - Line: 311
Post by: mahdi1234 on May 27, 2009, 09:40:40 pm
Thanks a lot Nibbler :)
Title: Re: "No file was uploaded !" - db_input.php - Line: 311
Post by: s/v laura ellen on June 03, 2009, 03:41:45 am
Fixed it for me too.

Thanks.
Title: Re: "No file was uploaded !" - db_input.php - Line: 311
Post by: juliane on June 04, 2009, 04:15:34 am
Thank you very much  ;)
Title: Re: "No file was uploaded !" - db_input.php - Line: 311
Post by: Joachim Müller on June 04, 2009, 11:21:18 am
Locked