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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:56:54+00:00 2026-06-04T06:56:54+00:00

As a bit of a follow up to Javascript form won't submit (to view

  • 0

As a bit of a follow up to Javascript form won't submit (to view the code I am using visit that link) I am now encountering a problem that I cannot find the file that has been uploaded.

I have added $files = apc_fetch('files_'.$_POST['APC_UPLOAD_PROGRESS']); to the top of my page and this is the output of print_r($files);

Array
(
    [theFile] => Array
        (
            [name] => tt1.mp4
            [type] => video/mp4
            [tmp_name] => /tmp/php2BEvy7
            [error] => 0
            [size] => 1050290
        )
)

However when I try to run the following code:

if (file_exists($files['theFile']['tmp_name'])) {

    $webinarType = strcmp($files['theFile']['type'], 'video/mp4');

    if($webinarType == 0) {

        $webinarFile = $fileTitle;
        $webinarTempName = $files['theFile']['tmp_name']; 

    } else {

        echo 'Webinar must be .mp4';

    }

} else {

    echo "No File";

}

I get the No File output.

I have ssh’d into the server and the file is not in /tmp/, /path/to/public_html/tmp/ or path/to/file/tmp/ all of which exist.

I have tried to use move_uploaded_file() but as this is executed on all file inputs I can’t get the tmp_name dynamically due to my limited knowledge of javascript.

tl;dr version; Where is my file gone and how can I find it?

NOTE; This form did work before the APC intevention and I am running wordpress in case that affects anything.

  • 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-04T06:56:55+00:00Added an answer on June 4, 2026 at 6:56 am

    Fixed this one on my own as well.

    In the progress.php file (found on the other question) I modified the elseif statement with this:

    elseif(($s_progressId = $_POST['APC_UPLOAD_PROGRESS']) || ($s_progressId = $_GET['APC_UPLOAD_PROGRESS']))
    {
        // If the file has finished uploading add content to APC cache
            $realpath = realpath($PHP_SELF); 
            $uploaddir = $realpath . '/tmp/';
            foreach ($_FILES as $file) {            
    
                if(!empty($file['name'])) {
    
                    $uploaded_file = $file['name'];
                    $moveme = $uploaddir.$uploaded_file;
    
                    move_uploaded_file($file['tmp_name'], $moveme);
    
                }    
    
            }
    
            apc_store('files_'.$s_progressId, $_FILES);
            die();
    }
    

    That way I could iterate through the $_FILES array without knowing the name of the input. I noticed that it loops through a couple of times hence the if(!empty()) however in hindsight it’s probably best practice anyway.

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

Sidebar

Related Questions

I am using the code to place a linkedIn Follow button (generated here https://developer.linkedin.com/plugins/follow-company
I'm new to Javascript and am having a bit of an issue with using
<a href=javascript:size('x')>HTML Link</a> I have the above code in my html file and want
Bit support question. Apologies for that. I have an application linked with GNU readline.
I am using jquery-1.4.2 library and jquery.validate.js plugin to validate a very simple form.
I am working on a bit of javascript to plot data on a <canvas
I have some JavaScript code and a button which already has an event/action assigned
I'm running JSLint checks in Rhino using jslintant.js . I found something a bit
Is there any way to follow a URL in JavaScript without setting the document.location.href
I'm using the raphael javascript library, and I'd like to draw a straight line

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.