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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:26:50+00:00 2026-06-11T05:26:50+00:00

Possible Duplicate: Upload files using input type=“file” field with .change() event not always firing

  • 0

Possible Duplicate:
Upload files using input type=“file” field with .change() event not always firing in IE and Chrome

I have the following code that successfully uploads a image using .submit()

// Photo Upload Form - AutoUpload
$('input#file').change(function() {
    var maxsize = '20971520';
    var fileExtension = $(this)
                            .val()
                            .split('.')
                            .pop()
                            .toLowerCase();

    if(this.files[0].size > maxsize) {
        $('h4#maxFileSizeExceeded').show();

    }else if($.inArray(fileExtension, ['gif','png','jpg','jpeg']) == -1) {
        $('h4#fileTypeNotAllowed').show();

    }else{
        if(pushState == '0') {
            $('div#uploadPercentage').hide();
            $('img#uploadGifLoaderHTML4').fadeIn('fast');
        }
        $('form#joinPhotoUploadForm').submit();
        jcrop_api.destroy();

        $('div#croppingBackgroundContainer').fadeIn(1000);
        $('div#cropBoxWrapper').css('margin-left', '0px');
    }
});

The issue I have is if the user requests the same file again there is no change and the submit doesn’t fire.

Is there a way for the same file to be requested again or to know its the same file again or some sort of reset that can be done on the input type=”file”?

********************* Update

      <form action="scripts/php/photo_processing.php?page=join&section=precrop" id="joinPhotoUploadForm" enctype="multipart/form-data">
        <input type="file" name="file" id="file"><br>
      </form>

user clicks a browse button and can select an image. If the user selects a different image the image will upload. However if the user selects the same image the .change() function doesn’t fire at all. I assume because its retaining the same state as before.

thx

  • 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-11T05:26:51+00:00Added an answer on June 11, 2026 at 5:26 am

    If the same file is selected into the input[type=file] there is no call for the change event since there is no change. Add a button to fire your code again or use the submit event on the form.

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

Sidebar

Related Questions

Possible Duplicate: Upload photo to users profile from photo URL, not input file field
Possible Duplicate: jQuery : simulating a click on a <input type=“file” /> doesn't work
Possible Duplicate: HTML5 input type file's multiple attribute not working in IE? i can
Possible Duplicate: How can I upload files asynchronously with JQuery? I have a file
Possible Duplicate: In JavaScript can I make a “click” event fire programmatically for a
Possible Duplicate: How to upload a file from a site using Selenium's java inteface
Possible Duplicate: upload a file to server without using a form? I'am able to
Possible Duplicate: How to hide text field in Html File Upload I'm setting up
Possible Duplicate: django file upload from json Hi am using the following ajax upload
Possible Duplicate: Full path from file input using jQuery I have the following html

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.