Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: "No file was uploaded !" - db_input.php - Line: 311  (Read 7801 times)

0 Members and 1 Guest are viewing this topic.

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
"No file was uploaded !" - db_input.php - Line: 311
« 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
Logged

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: "No file was uploaded !" - db_input.php - Line: 311
« Reply #1 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.
Logged

Nibbler

  • Guest
Re: "No file was uploaded !" - db_input.php - Line: 311
« Reply #2 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');
Logged

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: "No file was uploaded !" - db_input.php - Line: 311
« Reply #3 on: May 27, 2009, 09:40:40 pm »

Thanks a lot Nibbler :)
Logged

s/v laura ellen

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: "No file was uploaded !" - db_input.php - Line: 311
« Reply #4 on: June 03, 2009, 03:41:45 am »

Fixed it for me too.

Thanks.
Logged

juliane

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: "No file was uploaded !" - db_input.php - Line: 311
« Reply #5 on: June 04, 2009, 04:15:34 am »

Thank you very much  ;)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: "No file was uploaded !" - db_input.php - Line: 311
« Reply #6 on: June 04, 2009, 11:21:18 am »

Locked
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.