Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Upload image through AJAX form in PHP

    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 577
    Comment on it

    You can easily upload an image through form in PHP.
    You need to add JavaScript file for send image data on server side through AJAX.

    Please add query.form.js in your code. You may download this js file form following link:
    https://github.com/malsup/form/
    http://plugins.jquery.com/form/

    The javascript code look like:

     var options = {
                url: "path of file",          
                beforeSend: function()
                {
    
                },
                uploadProgress: function(event, position, total, percentComplete)
                {
    
    
                },
                success: function(data)
                {
    
    
                },
                complete: function(response)
                {
    
                },
                error: function()
                {
    
    
                }
            };
            $("#form").ajaxForm(options);      
            $("#form").submit();   
    

    Write normal HTML code and file upload code on PHP side.
    Cheers :)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: