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

  • Home
  • SEARCH
  • 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 9229077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:29:01+00:00 2026-06-18T05:29:01+00:00

when I send the request the alert is blank. the files are uploaded fine,

  • 0

when I send the request the alert is blank. the files are uploaded fine, just no responsetext. Am I doing something wrong here?

var request = new XMLHttpRequest();

request.open('POST','upload.php');
request.setRequestHeader('Cache-Control','no-cache');
request.send(data);
alert(request.responseText);

and upload.php

if(!empty($_FILES['file'])){
foreach  ($_FILES['file']['name'] as $key => $name) {
if($_FILES['file']['error'][$key] == 0 && move_uploaded_file($_FILES['file']['tmp_name'][$key],"video/$name"))
    {
       $x = "1";
    }
        else
    {
      $x = "2";
    }
  }
}
   if ($x == "1"){echo "success";}
   if ($x == "2"){echo "failed";}
  • 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-18T05:29:02+00:00Added an answer on June 18, 2026 at 5:29 am

    You have handled the output for $x where it’s value are 1 and 2. What if $x is not set at all?

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

Sidebar

Related Questions

i am using the following code to send request to the server var url='getDNormalForm.action';
Can i send the request to load certain div with a url only something
function get_request(url) { var request = new getXMLObject(); request.onreadystatechange = function () { if
Here is my AJAX function: /** * Send an AJAX request * * @param
How can I send request to a URL: http://www.flashi.tv/embed.php?v=HitSportsNet41125 on port 80 with referrer
in javascript how to send request some url at a partcular time(e.g daily 5
I'm working on a project where I'm trying to send request to our webservice
I am using JSON-RPC. When i send request to server i get a response
I have a some code to ajax upload . its send request to my
I want to send Ajax request to controller, I make like this in the

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.