Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6216985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:20:45+00:00 2026-05-24T07:20:45+00:00

Okay this has baffled me. My script works in Mozilla but not IE. I

  • 0

Okay this has baffled me. My script works in Mozilla but not IE. I get this error in IE:

Warning: move_uploaded_file(uploads/properties/yh96gapdna8amyhhmgcniskcvk9p0u37/) [function.move-uploaded-file]: failed to open stream: Is a directory in /homepages/19/d375499187/htdocs/sitename/include/session.php on line 602

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpJkiaF3' to 'uploads/properties/yh96gapdna8amyhhmgcniskcvk9p0u37/' in /homepages/19/d375499187/htdocs/sitename/include/session.php on line 602

my code at Session.php is:

function addPhoto($subphotoSize,$subphotoType,$subphotoTmpname,$subphotoDesc,$subfieldID,$subsessionid){
    global $database, $form;

    /* Get random string for directory name */
    $randNum = $this->generateRandStr(10);

    $maxFileSize = 2500000; // bytes (2 MB)
    $filerootpath = PHOTOS_DIR.$subsessionid."/";
    if($subphotoType == "image/png"){
        $filename = $randNum.".png";
    } else if ($subphotoType == "image/jpeg"){
        $filename = $randNum.".jpg";
    }
    $fullURL = $filerootpath.$filename;

    /* Image error checking */
    $field = "photo";
    if(!$subphotoTmpname){
        $form->setError($field, "* No file selected");
    } else {
        if($subphotoSize > $maxFileSize) {
            $form->setError($field, "* Your photo is above the maximum of ".$maxFileSize."Kb");
        } else if (!is_dir($filerootpath)){
            mkdir($filerootpath,0777);
            chmod($filerootpath,0777);
        }
        move_uploaded_file($subphotoTmpname, "$fullURL");
    }
    /* Errors exist, have user correct them */
    if($form->num_errors > 0){
        return 1;  //Errors with form
    } else {
        if($subfieldID == "1"){ // If the first field...
            $is_main_photo = 1;
        } else {
            $is_main_photo = 0;
        }
        if(!$database->addNewPhoto($ownerID,$subphotoDesc,$fullURL,$userSession,$is_main_photo, $subsessionid)){
            return 2; // Failed to add to database
        }
    }
    return 0; // Success
}

It creates the folder no problem but doesnt do anything else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:20:47+00:00Added an answer on May 24, 2026 at 7:20 am

    Add a log message to see what’s the value of $subphotoType. My guess is that when you upload the file from Internet Explorer it’s neither image/png nor image/jpeg, in which case $filename will be empty because you don’t have an else clause.

    if($subphotoType == "image/png"){
        $filename = $randNum.".png";
    } else if ($subphotoType == "image/jpeg"){
        $filename = $randNum.".jpg";
    } else {
        // No else! $filename will be empty.
    }
    

    If you tune your error reporting settings properly you should see a notice saying you are trying to use an undefined variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay guys, I'm sure this has a very simple solution but my searches are
Okay i know this has been asked a lot but it seems that none
Okay i know this has been a question asked b4, but since it should
Okay, this has got to be something stupid-as-a-box-of-rocks that I'm doing wrong, but I
okay, this has got to be simple - but I can't seem to find
Okay, I know this has been asked before, but the solutions to previously asked
Okay I'm really sorry if this question has been asked, but I can't seem
Okay people, I'm sure someone has had this issue and can help me out.
Okay this is definitely a n00b question but here goes. The way I understand
Okay this is definitley an easy question and a stupid one but since I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.