UPLOAD FILE WITHOUT FORM SUBMIT (POSTBACK) USING JQUERY AJAX IN ASP

Here Mudassar Ahmed Khan has explained ith an example, how lớn upload tệp tin without form Submit (PostBack) using jQuery AJAX in ASP.Net using C# and VB.Net.The Generic Handler will be used lớn upload và save files in thư mục (Directory) in ASP.Net.The Generic Handler will be called using jQuery AJAX and the file will be uploaded to folder (Directory) with Progress Bar using HTML5 size Data and XmlHttpRequest (XHR).

Bạn đang xem: Upload file without form submit (postback) using jquery ajax in asp


*

The uploaded tệp tin is read from the Request.Files collection và is saved lớn a folder (Directory) on Server’s Disk.
The HTML Markup consists of a khung with an HTML FileUpload element and a Button. Below the khung there’s an HTML5 Progress element for displaying the progress of the uploading File.
The Upload Button has been assigned a jQuery Click sự kiện handler. When the Upload button is clicked, an AJAX hotline is made khổng lồ the Generic Handler using jQuery.

Xem thêm:


The data of the selected tệp tin is read into an HTML5 FormData JavaScript object and the file is uploaded using XmlHttpRequest (XHR).
A Progress event handler is attached to the XmlHttpRequest (XHR), which displays the progress of the tệp tin being uploaded using the HTML5 Progress element.
script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">script>
*

The above code has been tested in the following browsers only in versions that tư vấn HTML5.

*
*
*
*
*

* All browser logos displayed above are property of their respective owners.


Thank you for the feedback. The phản hồi is now awaiting moderation. You will be notified via thư điện tử when the author replies lớn your comment.
You can add your phản hồi about this article using the form below. Make sure you provide a valid thư điện tử address else you won"t be notified when the author replies lớn your commentPlease cảnh báo that all comments are moderated và will be deleted if they areNot relavant lớn the articleSpamAdvertising campaigns or links to other sitesAbusive content.Please bởi vì not post code, scripts or snippets.

Disclaimer: The code samples & API available at www.obatambeienwasirherbal.com are available absolutely free. You are không tính phí to use it for commercial as well as non-commercial use at your own risk, but you cannot use it for posting on blogs or other tutorial websites similar lớn www.obatambeienwasirherbal.com without giving reference links to the original article. All the code samples and API provided by the authors are solely their creation và neither the tác giả nor the site are responsible if it does not work as intended.