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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:31:08+00:00 2026-05-30T04:31:08+00:00

I’m using a flash/ajax file upload in php based on this site – http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/

  • 0

I’m using a flash/ajax file upload in php based on this site – http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/

There is a little inconsistency in the behavior I’m getting.

One result is having the process hang at what looks like 100%. (I can cancel and do other things on the page but I just doesn’t go further.)

The other is I hit the upload_success_handler but the file is still not uploaded to the server. I even temporarily changed my permissions to 777 to rule all that out, it still doesn’t get uploaded.

If anyone has any experience with this type of thing, I would like to ask what gets sent to the ajax called file and how does it get sent (get/post). Also, what exactly do I need to do on the file called by ajax and what do I have to return? Do I “return” the file name just by echoing it, or would I actually use the “return” command as if it was a function. All it says on the blog Is following is

The handler should save the uploaded file to disk, then return a unique token, such as a GUID or filename, to will identify the file you just uploaded.

Currently what I have for my code in that file is as so

<?php
ini_set('post_max_size', 510000000);
ini_set('upload_max_filesize', 500000000);
ini_set('max_input_time', 20);
ini_set('memory_limit', 520000000);

if (!empty($_FILES['file']['name'])) //checking if file upload box contains a value
{

    $saveDirectory = 'videos/';         //name of folder to upload to
    $tempName = $_FILES['file']['tmp_name'];    //getting the temp name on server
    $fileName1 = $_FILES['file']['name'];       //getting file name on users computer

    $test = array();
    $test = explode(".", $fileName1);
    if((count($test) > 2) || ($test[1] != "avi" && $test[1] != "AVI" && $test[1] != "flv" && $test[1] != "FLV" && $test[1] != "mov" && $test[1] != "MOV" && $test[1] != "mpeg" && $test[1] != "MPEG" && $test[1] != "mp4" && $test[1] != "MP4" && $test[1] != "wmv" && $test[1] != "WMV")){
        $err .= "Invalid file type.  Files must have only one period \".\" and be of type .avi .flv .mov .mpeg .mp4 or .wmv";
        echo $err;

    }else{

        $count = 1;
        do{
        $link = $saveDirectory . $count . $fileName1;
        $count++; 
        }while(is_file($link));
        if (move_uploaded_file($tempName, $link))   //Moves the temp file on server
        {                                           //to directory with real name


            echo $link;

        } 
        else 
        {
            $err .= "There was an error while uploading the file.";

            echo $err;
        }
    }
}
?>
  • 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-30T04:31:10+00:00Added an answer on May 30, 2026 at 4:31 am

    I Figured it out. Turns out the javascript from the blog was renaming the file input to something other then what I gave it. Once I adjusted my code accordingly, it worked. I figured that out after It was suggested to me to output the $_FILES[] variables. The output of my asyncupload.php script was ported back into one of the hidden inputs generated by the javascript.

    I just figured I would post my solution for anyone else with this issue.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, 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.