Announcement

Collapse
No announcement yet.

file uploads of any sort prob

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • file uploads of any sort prob

    Warning: filesize(): open_basedir restriction in effect. File(/tmp/phpG10pn8) is not within the allowed path(s): (/home/) in /home/www/trahtalk/trashUall/Now/admin/functions.php on line 1827


    Hi

    This is driving me mad, and I have searched the forum but cant find anything like this. This is my first time of installing the the latest Vb2 board although I have done phpBB2 boards in the past.

    this error message happens when anyone tries to upload sig, pic or attatchment.

    the server isnt in safemode as I checked the phpinfo.
    even clicked on safe mode and made a temp folder (777) and changed the image path to it...still got the same problem
    the images/avatar folders are 777
    I have tried increasing the file size in admincp
    phpinfo file says file uploads is on
    have clicked on allow sigs avatar and attatchments in admin cp
    have tried to add JPEG and GIF in bif letters as allowed file types..

    have opened the functions file in notepad and line 1827 reads....

    $filesize=filesize($attachment);
    if ($maxattachsize!=0 and $filesize>$maxattachsize) {
    // too big!
    @unlink($attachment);
    eval("standarderror(\"".gettemplate("error_attachtoobig")."\");");
    exit;
    }
    if ($filesize!=$attachment_size) {
    // security error
    @unlink($attachment);
    eval("standarderror(\"".gettemplate("error_attacherror")."\");");
    exit;
    }
    if (strstr($attachment,"..")!="") {
    //security error
    @unlink($attachment);
    eval("standarderror(\"".gettemplate("error_attacherror")."\");");
    exit;
    }
    if ($extension=="gif" or $extension=="jpg" or $extension=="jpeg" or $extension=="jpe" or $extension=="png" or $extension=="swf") { // Picture file
    if ([email protected]($attachment)) {
    if (($maxattachwidth>0 and $imginfo[0]>$maxattachwidth) or ($maxattachheight>0 and $imginfo[1]>$maxattachheight)) {
    @unlink($attachment);
    eval("standarderror(\"".gettemplate("error_attachbaddimensions")."\");");
    }
    if (!$imginfo[2]) {
    @unlink($attachment);
    eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
    }
    } elseif (1 or !$allowimgsizefailure) {
    @unlink($attachment);
    eval("standarderror(\"".gettemplate("error_avatarnotimage")."\");");
    }
    }
    // read file
    $filenum = fopen($attachment,"rb");
    $filestuff = fread($filenum,$filesize);
    fclose($filenum);
    @unlink($attachment);
    $visible = iif($moderate,0,1);
    // add to db
    if (!$allowduplicates) {
    if ($result=$DB_site->query_first("SELECT attachmentid
    FROM attachment
    WHERE userid = '$bbuserinfo[userid]'
    AND filedata = '".addslashes($filestuff)."'")) {
    $threadresult=$DB_site->query_first("SELECT post.threadid as threadid,thread.title as title FROM post
    LEFT JOIN thread ON (thread.threadid = post.threadid)
    WHERE post.attachmentid=$result[attachmentid]");
    $threadresult['title'] = htmlspecialchars($threadresult['title']);
    eval("standarderror(\"".gettemplate("error_attachexists")."\");");
    exit;
    }
    }
    $DB_site->query("INSERT INTO attachment (attachmentid,userid,dateline,filename,filedata,visible) VALUES (NULL,$bbuserinfo[userid],".time().",'".addslashes($attachment_name)."','".addslashes($filestuff)."','$visible') ");
    $attachmentid=$DB_site->insert_id();
    }
    return $attachmentid;
    }


    it doesnt seem to matter if its a pic the size of a pin head it happens.
    Funny thing is and I dont know if its related, i get the same error message when I deleted vb2 and put in vb3

    any help would be very much appreciated. I like vbulletin. i dont want to go back to phpBB2 if i can help it.

    thanks
    Sarky
    Last edited by Sarky; Fri 30 Jan '04, 1:50pm.

  • #2
    Upload the phpinfo.php file from the 'extras' directory of the zip file to your forums directory. Then post the URL here. This will help us troubleshoot the problem.
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      http://www.trashtalkers.co.uk/trashUall/Now/phpinfo.php


      thank you steve

      Comment


      • #4
        You have open_basedir restrictions on your server. To get uploads to work you need to create a 'tmp' subdirectory under your home directory and chmod it to 777. Then in the Admin CP set "Upload In Safe Mode?" to 'Yes' and point the "Safe Mode Temp Directory" to that directory. If you placed the tmp directory in the right place, the path to the Safe Mode Temp Directory will be:

        /home/www/trahtalk/tmp
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment


        • #5
          Wow Vote Steve for President heheh
          It worked
          Obviously the path was wrong as I had it set to images/avatars and then tried images/temp. Didnt think of putting the folder outside the files for the forum.

          I would love to uninstall the vb2 and have a go with the new vb3 as this was all that was stopping it from working.
          is it me doing something wrong.....here comes the next question....or can the files like pics be viewed underneath and not as a downloadable zip file??


          how do you restrict it to just picture files and not anything else

          many thanks again...wonderful service.
          Last edited by Sarky; Fri 30 Jan '04, 2:36pm.

          Comment


          • #6
            Not sure what you mean as a 'downloadable zip file'. Can you explain?
            Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
            Change CKEditor Colors to Match Style (for 4.1.4 and above)

            Steve Machol Photography


            Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


            Comment


            • #7
              Hi there,

              Wow Vote Steve for President
              I vote yes

              You do not need to uninstall version 2 and start over with version 3.
              vBulletin version 3.x comes with a install.php and upgrade.php set of files, so you can just upgrade your version 2 installation to version 3 and not loose any of the members, threads, forum setups, etc.

              version 3 comes with a Attachments Manager, from where you can set extention details.

              With that I mean that you can setup which .ext files are allowed to be uploaded.
              If you only want .zip files, then you can add the extention for .zip and set a max file size.
              If you also want users to upload .gif images, then you can add the .gif and set a max file size and some other details and include the mime.

              The mime helps to show the images inline if you turn that on, and it lets you view the image in the browser, rather then get prompted to download/open it.

              version 3 also comes with a nice feature that uses the 'gd' lib. This helps generate thumbnails of the uploaded image, before you click them (ofcourse, this only works with .jpg and .png (for version 1.6.2+) but also for .gif (version 2+). Not for .bmp files.

              I hope my reply is a bit clear and clears things up for you.

              If you have more questions, feel free to ask.
              Attached Files
              Last edited by Floris; Fri 30 Jan '04, 4:10pm.

              Comment


              • #8
                now this is what I call help
                version 3 looks really good so I will have a go with just doing the upgrade files

                er..vote Floris for President too! LOL

                thank you both
                Last edited by Sarky; Fri 30 Jan '04, 5:07pm.

                Comment


                • #9
                  I second that second vote too!!

                  I am glad we were able to help, if you have more questions, feel free to ask.

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...
                  X