Home > Blog

How to do ajax file upload

<html> <head> <title>File Upload with PHP</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.form.js"></script> <script> $(document).ready(function() { $('#FileUploader').on('submit', function(e) { e.preventDefault(); $('#uploadButton').attr('disabled', ''); // disable upload button //show uploading message $("#output").html('<div style="padding:10px"><img src="images/ajax-loader.gif" alt="Please Wait"/> <span>Uploading...</span></div>'); $(this).ajaxSubmit({ target: '#output', success: afterSuccess //call function after success }); }); }); function afterSuccess() { $('#FileUploader').resetForm(); // reset form $('#uploadButton').removeAttr('disabled'); //enable submit button } </script> </head> <body> <div id="theForm"> <div id="output"></div> <form action="uploader.php" id="FileUploader" enctype="multipart/form-data" method="post" > <label>Title <span class="small">Title of the File</span> </label> <input type="text" name="mName"

Read More

Top 10 Popular travel destinations in India

1.) Munnar Sprawling tea plantations surround the serene hills of Munnar, which attract adventure travelers hungry for paragliding, treks to Anaimudi (South India’s highest peak) and hikes originating at the confluence of three mountain streams. The stone Christ Church, built by the British in 1910, is adorned with renowned works of stained

Read More