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 8248923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:21:37+00:00 2026-06-07T23:21:37+00:00

I’m trying to process a form on a MVC system but I’m unable to

  • 0

I’m trying to process a form on a MVC system but I’m unable to save the image on the server.
The error I’m getting is:

Warning: move_uploaded_file(/xcomplete/xtyre/public/images/products/brunofitasHD.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/gbengmux/public_html/xcomplete/xtyre/models/insert_model.php on line 120

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpFHXzmh' to '/xcomplete/xtyre/public/images/products/brunofitasHD.jpg' in /home/gbengmux/public_html/xcomplete/xtyre/models/insert_model.php on line 120

Here’s my code

The form, displayed by the view class:

<form action="<?php echo DOC_ROOT;?>/insert" class="mainForm" id="tyreForm"    method="POST" enctype="multipart/form-data">

<!-- Dropdowns and selects -->
        <fieldset>
            <div class="widget">

                //OTHER FIELDS HERE...

                <div class="rowElem">
                    <label>Photo:</label> 
                    <div class="formRight">
                        <input type="file" name="file" id="file" class="fileInput"  />

                         <input id="submitButton" type="button" value="Insert" class="greyishBtn submitForm" />

                    </div>
                    <div class="fix"></div> 
                </div>
            </div>     
    </fieldset>
</form>

The controller:
@ /insert

    class Insert extends XController{

             public function __construct(){
            parent::__construct();
            if(XSession::get(APP_NAME.'/loggedIn')){

                $this->view->pageTitle = "Insert Tyres";
                $this->loadModel("insert_model");

            }
            else{
                header('location: '.DOC_ROOT.DS.'login');
            }



        }
         //THIS FUNCTION IS CALLED AFTER THE CONSTRUCTOR

        public function index(){

            //CALLING THE FUNCTION TO PROCESS FORM

            $this->model->run();

            //GETTING MODEL VARS
            $this->view->pars = $this->model->getPars();
            //LOADING MODULES
            $this->loadModule("mod_top_nav");
            $this->runModules();
            //RENDER VIEW   
            $this->view->render("insert");
        }
...
}

the model that processes the form:

class Insert_Model extends XModel{

function __construct(){
    parent::__construct();
    $this->xdb->open();
    $this->getBrands();
    $this->getWidth();
    $this->getDiameter();
    $this->getRatio();
    $this->getLoadIndex();

}

function run(){
    //OTHER POST 's...


            //processing data


            if (($_FILES["file"]["type"] == "image/gif")
            || ($_FILES["file"]["type"] == "image/jpeg")
            || ($_FILES["file"]["type"] == "image/png")
            || ($_FILES["file"]["type"] == "image/pjpeg"))
            {
                if($_FILES["file"]["size"] < 100000){
                    if ($_FILES["file"]["error"] > 0){
                        array_push($this->pars['error'], 'File Error');
                        return false;
                    }
                    else{
                        //THE ERROR IS HERE

                        if(move_uploaded_file($_FILES["file"]["tmp_name"],
                                   DOC_ROOT."/public/images/products/" . $_FILES["file"]["name"])){
                                return true;
                        }
                        else{
                            array_push($this->pars['error'], 'Could not save file');

                        }
                    }
                }
                else{
                    array_push($this->pars['error'], 'File is too big');
                    return false;
                }

            }
            else{
                array_push($this->pars['error'], 'Invalid File');
                return false;
            }


            //PROCESS DATA ETC...

Thanks guys

  • 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-06-07T23:21:39+00:00Added an answer on June 7, 2026 at 11:21 pm

    Looking at this error:

    Warning: move_uploaded_file() [function.move-uploaded-file]:
    Unable to move '/tmp/phpFHXzmh' 
    to 
    '/xcomplete/xtyre/public/images/products/brunofitasHD.jpg' 
    in /home/gbengmux/public_html/xcomplete/xtyre/models/insert_model.php on line 120
    

    It appears as though the path is wrong IE missing something off the start.. should it not be trying to the file to this?

    /home/gbengmux/public_html/xcomplete/xtyre/public/images/products/brunofitasHD.jpg
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

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.