3

I have img object upload by user for simple:

<img alt="" id="imgpics" src="data:image/png;base64,iVBORw0KGgoAAAANSUh.....

I want upload image through jQuery.ajax

<script type="text/javascript">
function callajax(){
    var data = new FormData(); 

    var blob = new Blob([imgpics.src], { type: "text/plain" });
    data.append("inputfile.64data", blob);
     $.ajax({    
            type:'post',        
            url:'ajaximage,    
            data: data,    
            cache:false,    
            mimeType: "multipart/form-data",
            success:function(data){
                alert("success");
               //alert(data.message);   
            },
            error: function(e){
               alert(e.massage());
               }   
        }); 

    }
</script>

I do not know why every time I call there are jQuery error for me:

NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object [Break On This Error]

value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); Is there anything wrong about calling?

where is my error? how to change it?

user504909
  • 9,119
  • 12
  • 60
  • 109
  • [This](http://stackoverflow.com/questions/12831680/jquery-ajax-multipart-form-data-not-sending-data) might helps – Mohan Oct 11 '12 at 07:12

1 Answers1

-2

I finally give up apply jquery, it seems jquery will read the img|src part and inside jquery it contain lots of string match or similar staff. when it do the img string it show get wrong.

user504909
  • 9,119
  • 12
  • 60
  • 109