Asynchronous File Upload using handler in Asp.net Development

banner

What is the Use Asynchronous file upload?

In Asp.net ajax, we have AsyncFileUpload control for uploading files asynchronously. But if you are using JQuery with your application then using AsyncFileUpload control is not a good practice to upload files asynchronously.

jQuery plugin and issue.

From last couple of days we were trying to find a way to upload file asynchronously using jQuery and Asp.net Handler. So, we have searched into google and find some jQuery plugins. First of all we found jQuery plugin from https://forum.codeigniter.com/thread-57640.html this website which is forced upload file to the server asynchronously using asp.net handle.

Don't Settle for Less: Get Your Expert Development Team Now!

Get expert developers, get results. Free quote today!

Using above plugin in our code we have found the issue that plugin works properly into Firefox and Chrome browser but in IE there is a security issue. When I try to upload file that does not saved in proper location then we debug the handler file and see the file which is pass to handler that include “c:\fakepath\” into the path. So this is the security issue that IE does not allow asynchronously upload file or image with this plugin (http://www.phpletter.com/Demo/AjaxFileUpload-Demo/).

Now we have to find another plugin which also works into all latest browsers. So we found a way and got solution form CodeProject, there is one article which is very useful to upload file asynchronously using jQuery and Asp.net handler. Then we download sample code from GitHub and implement those into our project using following step.

How to implement in our project?

To implement Valums File Uploader pluing into asp.net project please follow following step.

Are you having problems uploading the files?

The right asynchronous handler using jQuery and Asp.net handler will make the difference. We can do the needful with our talent in this domain.

1) Download sample project from GitHub using this link (http://github.com/valums/file-uploader).

2) Find and put fileuploader.js file into your project.

net

3) Find and put style from site.css file to your project.

net

4) Now add FileUpload handler file to your project and then you can set folder path when you want to save image asynchronously.

net

5) Create one new page. And just include fileuploade.js and site.css into your page.

6) Add file uploader div to your new created page.

net

7) Include following script in your script section.

net

8) Run your project, now you can see Upload file button by click on that button you can choose image from your local machine and save that image where you want without page refresh.

img

Conclusion

Main benefit of valums/file-uploader plugin is that provide browser compatibility. We can use in our asp.net application development and it works in all latest browser like IE, Chrome, Firefox. Thus, the developer does not need to worry about browser issue. Wishing you a great Microsoft .net development career ahead.

For further information, mail us at [email protected]

Empower your Business with Team Aegis, CONNECT NOW!
captcha

Scale your Business with our Software Services Now!
Related article

There are different types of programs which are installed in desktops and laptops. ASP.NET is also one of those programs.

Things that a developer needs to deliver a successful asp.net solution Aegis professionals have got three major essentials for asp.net

The world is getting digitized – people have learnt and started trading and dealing with online secure enterprise portal.

DMCA Logo do not copy