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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:42:33+00:00 2026-06-04T08:42:33+00:00

I need the simplest solution for uploading file from Ext application with php. I’m

  • 0

I need the simplest solution for uploading file from Ext application with php. I’m a total php newbie, so I don’t get the errors I’m recieving and can only guess what’s causing them. On the frontend side I have a simple form :

Ext.create('Ext.form.Panel', {
    width: 300,
    renderTo: Ext.getBody(),
    frame: false,
    title: 'File Upload Form',
    bodyPadding: '10 10 0',

    defaults: {
        anchor: '100%',
        allowBlank: false,
        msgTarget: 'side',
        labelWidth: 50
    },

    items: [{
        xtype: 'filefield',
        id: 'form-file',
        emptyText: 'Select mpp file',
        fieldLabel: 'File',
        name: 'mpp-file',
        buttonText: '',
        buttonConfig: {
            iconCls: 'upload-icon'
        }
    }],
    buttons: [{
        text: 'Upload',
        handler: function(){
            var form = this.up('form').getForm();
            if(form.isValid()){
                form.submit({
                    url: 'msp-load.php',
                    waitMsg: 'Loading data...',
                    success: function(fp, o) {
                        msg('Success', 'Data from .mpp file loaded ');
                    }
                });
            }
        }
    }]
})

The msp-upload.php looks as follows :

<?
if(isset($_FILES)){
    $file_tmp  = $_FILES['mpp-file']['tmp_name'];
    $file_name = $_FILES['mpp-file']['name'];
    $file_size = $_FILES['mpp-file']['size'];

    //echo ($file_tmp.", ".$file_name.", ".$file_size);

    if(is_uploaded_file($file_tmp)) {
        if(move_uploaded_file($file_tmp, "tmp/$file_name")){
            echo '{success: true}';
        } else {
            echo '{success: false}';
        }    
    }  else{
        echo '{success: false}';
    }
}
?>

After clicking ‘Upload’ I get :

uncaught exception: Ext.JSON.decode():
You're trying to decode an invalid JSON String:
<br> <b>Warning</b>: move_uploaded_file(tmp/MSP1.mpp) [<a href="function.move-uploaded-file">function.move-uploaded-file</a>]: failed to open stream: No such file or directory in <b>/Library/WebServer/Documents/examples/MSProject_import/msp-load.php</b> on line <b>10</b><br>
<br> <b>Warning</b>: move_uploaded_file() [<a href="function.move-uploaded-file">function.move-uploaded-file</a>]: Unable to move '/private/var/tmp/phpJVDktB' to 'tmp/MSP1.mpp' in <b>/Library/WebServer/Documents/examples/MSProject_import/msp-load.php</b> on line <b>10</b><br> {success: false}

Where does this : ‘No such file…’ error come from? It can’t find the uploaded file, or something else? My server user has admin privileges so it’s not about permissions.

I’m using built-in OSX 10.7 server with PHP 5.3.6 . No errors in the error.log .

  • 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-04T08:42:35+00:00Added an answer on June 4, 2026 at 8:42 am

    As mentioned above there are two possible problems.

    1. Path Error(basically path which you are giving to upload is not valid)
    2. Or the wrong permission are given. (CHMOD 777)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to reduce this boolean expression to its simplest form. Its given that
I need to take a caught exception and get a String that is what
I need to create a simple document assembly application to create Word files. We
This may sound weird. I need the simplest way to register the order of
I need to read the nth line of a text file (e.g. textfile.findline(0) would
I am looking for this simplest, plainest way to get a Java web service
I need to save some image files from user directory to the project folder
Need to insert selected text on the page into textarea. There must be some
Need to call a filter function on some options based on a radio selected
need to add a 2nd css stylesheet to a page. do i add a

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.