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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:11:03+00:00 2026-05-25T00:11:03+00:00

I currently have an enquiry submission form that can only be completed by registered

  • 0

I currently have an enquiry submission form that can only be completed by registered users.

Part of the form allows the user to upload a file to be attached to their enquiry.

What I am attempting to do is pass the $_FILES variable to a class file for processing (using class.upload.php) as I want the file name to be in the following format:

enquiryID_userID_fileName.ext

Is it possible to pass the form $_POST data to a class along with the $_FILES data?

An example of what I am attempting to achieve is the following:

if (isset($_POST['submit_enquiry'])) {
    $enquiry = new Enquiry();
    $enquiry->newEnquiry($_POST, $_FILES);
}

Then in the Enquiry Class:

class Enquiry {

    private function _processFiles($_FILES, $caseID) {
        ...
    }

    private function _processForm($_POST) {
        ...
    }

    public function newEnquiry($_POST, $_FILES) {
        $caseID = $this->_processForm($_POST); // returns caseID
        $this->_processFiles($_FILES, $caseID);
    }
}

A print of $_FILES gives me the following:

Array
(
    [file] => Array
        (
            [name] => Array
                (
                    [0] => Blue hills.jpg
                    [1] => Sunset.jpg
                    [2] => 
                )

            [type] => Array
                (
                    [0] => image/jpeg
                    [1] => image/jpeg
                    [2] => 
                )

            [tmp_name] => Array
                (
                    [0] => /tmp/phpwyLp86
                    [1] => /tmp/phpKJa4iw
                    [2] => 
                )

            [error] => Array
                (
                    [0] => 0
                    [1] => 0
                    [2] => 4
                )

            [size] => Array
                (
                    [0] => 28521
                    [1] => 71189
                    [2] => 0
                )

        )

)

When attempting to process the file it’s almost as if the tmp file has been lost as it can’t process the file to be uploaded. Are there any obvious issues I have missed attempting to implement this solution?

  • 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-25T00:11:04+00:00Added an answer on May 25, 2026 at 12:11 am

    The upload tmp files will be deleted when your script finishes. As long as it didn’t finish, the files are still there.

    However, if you move them or if the form goes accross multiple requests (e.g. multi-step form, validation that requires re-submission), you need to build your own tmp files.

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

Sidebar

Related Questions

Currently I am making an online enquiry form with a set of fields that
Currently have a form with a ListView. Users of role A get an image
Currently have a drop down menu that is activated on a hover (from display:none
I currently have a XSLT 2.0 Stylesheet that I am trying to remove empty
I currently have one project that currently contains multiple packages. These packages make up
I currently have a form with inputs and name attributes. I'm able to get
I currently have a deployed app (fortworth.herokuapp.com) that I am attempting to sort movies
I currently have a Web Application that runs off a global Javascript-based API, and
I currently have a string, say $line='55.25040882, 3,,,,,,' , that I want to remove
I currently have a search that looks like this: SELECT s.ID FROM Shoe s

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.