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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:34:13+00:00 2026-06-09T02:34:13+00:00

I am uploading images using ajax and php. My code is working fine in

  • 0

I am uploading images using ajax and php. My code is working fine in firefox. But in I.E, it doesn’t work!

Here is my HTML code,

<!doctype html>
<head>
<title>File Upload Progress Demo #1</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<style>
body { padding: 30px }
</style>
</head>
<body>
    <h1>File Upload Progress Demo #1</h1>
        <form action="fileup.php" method="post" enctype="multipart/form-data">
        <input id="inp" type="file" name="uploadedfile" style="display:none"><br>
        <input id="btn" type="submit" value="Upload File to Server" style="display:none">
    </form>

    <div id="fileSelect" class="drop-area">Select some files</div>

<script>
(function() {

$('form').ajaxForm({

    complete: function(xhr) {
        alert(xhr.responseText);
    }
}); 

})();       


var fileSelect = document.getElementById("fileSelect"),
fileElem = document.getElementById("inp");


fileElem.addEventListener("change",function(e){
  document.getElementById('btn').click();
},false)  


fileSelect.addEventListener("click", function (e) {
  fileElem.click();
  e.preventDefault(); 
}, false);


</script>

</body>
</html>

Here is php code,

<?php
$target_path = "images/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}
?>

In firefox the file uploads perfectly and alert comes up, But in I.E nothing happens!

  • 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-09T02:34:14+00:00Added an answer on June 9, 2026 at 2:34 am

    From the examples page of the form plugin

    Browsers that support the XMLHttpRequest Level 2 will be able to
    upload files seamlessly.

    IE doesn’t support XMLHttpRequest Level 2.

    EDIT:

    Okay, it doesn’t seem to be an Ajax issue, because the plugin uses a iframe fallback. You may need to refactor your javascript code

    $(function(){
        $('form').ajaxForm({
            complete: function(xhr) {
                alert(xhr.responseText);
            }
        }); 
    
        $('#inp').change(function(e) {
            $('#btn').click();
        });
    });
    

    But as a side note, file drop is also not available in IE. So it only works if you select a file manually in IE. And a hidden file select will not allow the user to select a file. Raising the click event from javascript on a file input is also not possible, you have to go with a transparent file input.

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

Sidebar

Related Questions

I am uploading image to server using base64 its working fine if image is
I am using Jquery Uploadify for images upload with PHP, here i have multiple
Iam using below code for uploading images on the remote server.When I use below
I've already seen Uploading images using Node.js, Express, and Mongoose but I'm using an
I am using this reference http://www.openjs.com/articles/ajax/ajax_file_upload/response_data.php for ajax uploader ,its working absolutely fine for
hi guys i am uploading the images using the @PhP file upload Method @
I am using an AsyncFileUpload tool for uploading images in a registration form. But,
I'm uploading images using Spring and Hibernate. I'm saving images on the server as
I'm using Spring and Hibernate. I'm uploading images using commons-fileupload-1.2.2 as follows. String itemName
I am uploading image using filedrop.js. Code in application.js file looks like this:- $(.droparea).each(function(event){

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.