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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:25:09+00:00 2026-06-10T19:25:09+00:00

I did an ajax upload with php.Everything wiil be perfect in firefox. But when

  • 0

I did an ajax upload with php.Everything wiil be perfect in firefox.

But when i test it in chrome browser its not working correctly.

That means it displays this :
enter image description here

This is my ajax upload code:

$(function(){
        var cntUp = 0;
        var btnUpload=$('#upload0');
        var status=$('#status');
        var state='left_front';

        new AjaxUpload(btnUpload, {
            action: 'upload-file.php',
            data: {saleid: $("#hid_saleid").val(),imag_state:state,custom:$('#custom').val()},
            name: 'uploadfile',
            onSubmit: function(file, ext){
                 if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ 
                    // extension is not allowed 
                    alert('Only JPG, PNG or GIF files are allowed');
                    return false;
                }
                this.setData({
                    'saleid': $("#hid_saleid").val(),
                    'imag_state':'left_front',
                    'custom':$('#custom').val()
                });

                status.text('Uploading...');
            },
            onComplete: function(file, response){
                var array_data=response.split('***');   
                var  fname= array_data[1];  
                var rand=Math.floor((Math.random()*10)+1); 
                var saleid = $("#hid_saleid").val();
                var custom = $('#custom').val();
                //On completion clear the status
                status.text('image uploaded');
                cntUp++;
                //console.log(cntUp);
                //Add uploaded file to list
                if (response.toLowerCase().indexOf("success") >= 0 ) {
                    var image='<img src="uploads/'+saleid+'/'+fname+'" alt=""  width="131px" height="125px"/>';
                    $("#img0").html(image);

                }  else{
                    $('<li></li>').appendTo('#files').text(file).addClass('error');
                    //alert('error');
                }
            }
        });

    });

This is the html code:

<div class="brwse_box">
<div style="float:left;" id="upload0">
<h3>Left Front</h3>

<img src="images/upload.gif" />
</div>
<div style="float:right; width:131; height:125" id="img0">
<?php if($l_ft==''||$l_ft==NULL) { ?>
  <img src="images/no-photo-lft-frnt.jpg"  id="bg"/>
<?php } if($l_ft!=''||$l_ft!=NULL){?>
   <img src="uploads/<?php echo $var_sid;?>/<?php echo $l_ft;?>" id="bg" width="131px" height="125px"/>
<?php }?>
</div>
</div><!--browse_box ENDS-->

How can i solve this?

It displaying image in firefox.but in chrome not displaying image instead of that displaying html of image tag.

EDIT:

This is the value return in fname variable:

left_front.jpg<div id=isChromeWebToolbarDiv" style="display:none"></div>

  • 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-10T19:25:10+00:00Added an answer on June 10, 2026 at 7:25 pm

    It seems you have a problem in the src string.
    Check it for escape characters…
    I’d say it’s possible that fname contains quotes…

    EDIT:
    What "isChromeWebToolbarDiv"?

    fname = fname.replace(new RegExp("<div id=isChromeWebToolbarDiv(.*)</div>"),'');
    

    or simply

    fname = fname.replace(new RegExp("<div(.*)</div>"),'');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small AJAX application, written in PHP that I did not secure
I tried every thing which i using but ajax did not display the output
i did a small ajax div refresh, but instead of replacing the values with
I did a code in jquery and ajax with working very well in Safari,
Did anybody write tests for ajax with jsunit? I don't now how to test
I did ajax call and got response in callback function like below: var v=;
Did you used Dynamic websites before? you see its a good way for making
Did you ever have the following situation: you need to store information, but a
Did about 30 minutes worth of searching, found lots of relevant info, but none
Did I not get enough sleep or what? This following code var frame=document.getElementById(viewer); frame.width=100;

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.