JS file upload the code

            var formData = new new the FormData (); 
            formData.append ( "File", $ ( "# the File1") [0] .files [0 ]); 
            $ .ajax ({ 
                URL: "ASHx / Uploadimg.ashx", // remember path replacement 
                type: 'the POST' , 
                data: formData, 
                // tell jQuery not to process the data transmitted 
                the processData: to false , 
                 // tell jQuery not to set the request Content-type header 
                contentType: to false , 
                beforeSend: function () { / / before sending
                    console.log ( "in progress, please wait" ); 
                }, 
                Success: function (responseStr) 
                { 
                    the SaveData (); // save event remember to replace 
                }, 
                error: function (responseStr) 
                { 
                    console.log ( "error" ) ; 
                }

Need to reference jquery.form.js

Guess you like

Origin www.cnblogs.com/ly-03-04/p/12088109.html