[How Do I:] File Uploads with an AJAX Style Interface

Please install Silverlight or click download to watch video locally.

In this video I will demonstrate, using ASP.NET, an AJAX style of uploading files from the client machine to your server. I say AJAX style because there is actually a problem using AJAX to upload files. The video will demonstrate what I mean.

Presented by Joe Stagner

Duration: 27 minutes, 33 seconds

Date: 12 February 2008

Watch    Video   |   Download    Video   |   VB Code    C# Code

Video downloads: WMV  |  Zune  |  iPod  |  PSP  |  MPEG-4  |  3GP

Audio downloads: AAC  |  WMA  |  MPEG-4  |  MPEG-3  |  MPEG-2

Comments : 40

Leave a Comment

Nirvana666 : On March 10, 2008 8:40 PM said:

thanks joe

that's very very big problem with Ajax & uploader

mohdasghar_ali : On March 17, 2008 8:57 AM said:

It's kool video.

thanx joe

ramah : On March 19, 2008 4:31 PM said:

very good video

but i have problem  that evry time i run the code

i got that error

Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (I:\CS-AJAX-Style-Uploads-CS\HDI-AJAX-Style-Uploads-CS\HDI- ASP-AJAX-Upload-Collection-CS\web.config line 72)

i have uploded the site in

http://www.edu4tech.com/romh/

i hope u can help me with that

JoeStagner : On March 25, 2008 2:25 PM said:

That error is an issue with the conversion.

Check out this blog post.

joeon.net/.../Fixing-an-ASPNET-20-App-after-upgrading-to-35.aspx

atikatak : On April 13, 2008 11:19 PM said:

Hi and thanks JoeStagner!!

It's running very well under IE but I have a problem with Firefox..

After I click over the upload button I may see an error at the error console like this: "btnUpload has no properties", could you help me? Thanks!

JoeStagner : On April 14, 2008 9:05 PM said:

atikatak - do you get this running the sample download. I can't reproduce.

weden : On June 12, 2008 12:43 PM said:

How would I go about putting more than one of these on a page?

Thanks,

Jay

nihadar@gmail.com : On June 17, 2008 4:41 AM said:

Thanx Joe

mimranm29 : On June 20, 2008 9:17 AM said:

Thanx Joe,

Imran

Punithkumar : On July 09, 2008 5:01 AM said:

Thanks Joe.

This is working fine for me.

This helped me a lot.

tsql : On July 27, 2008 12:04 PM said:

Every article that I see on this only shows the "SAVEAS" path going to a local physical drive. However: the PATH syntax for a web site operates a little differently.  It would be nice to see this added as a demo..

dmitry39 : On August 01, 2008 11:10 AM said:

o, thx it will be on my site soon

dmitry39 : On August 01, 2008 11:11 AM said:

asp.net for Russia at http://www.progblog.ru/

muhammed : On August 07, 2008 12:30 AM said:

thanks good video

cv_vikram : On August 09, 2008 8:34 AM said:

thanks.....

scottt40 : On August 23, 2008 10:28 PM said:

Joe, I loved the article, however, I have had lots of issues displaying pictures with asp.net from a database.  I would be great to have an asp.net control which might retrieve pictures from a database, and/or a file server or service in upcoming asp.net 4.0.  I might also make a great asp.net video.

xjpmauricio : On August 26, 2008 6:18 AM said:

Great article. Just wondering...why is that the asp.net team didn't include an ajax upload control on the ajax extensions? the know how is everywhere so...i don't understand!

djibril_chimere_DIAW : On October 29, 2008 10:40 AM said:

Thanks! Jërëjëf!

magivenki : On November 06, 2008 1:22 AM said:

thanks joe

djafer : On November 11, 2008 1:36 PM said:

Teşekkürler Mr. Joe güzel çalışma.

SoulGen : On November 28, 2008 1:33 AM said:

Great video I ever saw!

yasserzaid : On December 02, 2008 6:31 AM said:

Good Example

thanks alot

bohunt : On December 24, 2008 6:03 AM said:

Great examples. thanks joe.

bit2009 : On January 11, 2009 12:41 PM said:

hello JoeStagner thanks for the video

but will you provide the videos in C#

baroque : On February 03, 2009 1:55 AM said:

This site is really so nice and I learned a lot from these videos.

betamax : On February 12, 2009 4:21 PM said:

Hello, I notice that the file upload html control in IE 8 is no longer giving full path to files. How do i fix this in IE 8?

amin_pucit : On February 24, 2009 8:39 AM said:

really nice video

Bill Clark : On March 01, 2009 2:41 AM said:

Great video! This might be outside the scope of this thread, but is there a way to do a file download? I tried using the iframe technique (the code-behind adjusts the mime type and uses response write). It works great if the button is inside the iframe. But if the click is generated outside the iframe, then IE says "internet explorer blocked this site from downloading files". Is there a way to do a clean file download from an AJAX page? Thanks again, your videos are excellent.

atarikg : On March 10, 2009 5:21 PM said:

Thanks,

But I think Microsoft Asp.NET teams should get started thinking of putting specific Ajax Uploader in new AJax Toolkit.

Mattw67 : On March 23, 2009 1:27 AM said:

Hi,

The upload doesn't work with Firefox 3.0.7

Do you know why?

Mattw67 : On March 23, 2009 1:29 AM said:

Hi,

I also need to fire the click from a button outside the iframe :

My post on the forum : http://forums.asp.net/t/1398268.aspx

Thanks for your help

Mattw67 : On April 03, 2009 7:32 PM said:

I've found the solution!

Check my post for details : http://forums.asp.net/t/1398268.aspx

drini83 : On April 07, 2009 1:49 PM said:

can someone repost the solution to the problem with firefox 3.0.7

im having the same problem with both firefox and IE the upload will not start from the iframe i, will get that the upload is on but the folder will not uppear in the drive and it is different from the solution shown in the video.

when i start upoading i dont get the fancy background with the blue bar filling.

i also tried to open this page "http://forums.asp.net/t/1398268.aspx" but is says that the page has been deleted

any helsp please

VadaJoe : On April 10, 2009 7:07 PM said:

I dig the example...

In the single file upload example, I've added a couple of tweaks.

In the FileUpload.aspx code behind, I added the image record to a database along with the upload.

In the default.aspx photoUploadComplete() javascript function, I added document.getElementById('Button1').click(); to the end. Button1 is a non displayed button in an updatepanel on my default.aspx page. The Button1_Click calls a databind for a datalist in the updatepanel that shows all the images that have been uploaded.

So, the IFrame uploads the photo (AJAXishly), then on complete, the document.getElementById('Button1').click(); calls the Button1_Click code behind and rebinds the datalist in the updatepanel to show the new image without a full page postback. Looks cool, now I just need to make it pretty.

agrawalbs : On April 10, 2009 8:15 PM said:

nice video , thanks

haithemara : On May 08, 2009 11:44 AM said:

Really nice video.

m1a1r : On May 25, 2009 2:53 PM said:

thanks

toakhtar : On May 29, 2009 7:07 AM said:

I have scenario, put detailsview in Updatepanel and in the detailsview I have fileupload control, On the detailsview inserting event I need the file that I have upload. Does anyone have solution of this issue?

Plz email me at

toakhtar@hotmail.com

Thanks alot

cyrussullivan : On June 03, 2009 5:31 AM said:

I have a DetailsView in an AJAX tab control that wont update because of this compatibility issue and like with most of these video I end up disappointed like a prom date with a minute man because it only shows an example with static data. How do you put this Iframe in a DetailsView and store the file path from the file upload to a column in a database?

carlosantonio : On August 27, 2009 8:20 PM said:

These videos about uploading files are just great. Thanks a lot. I have a maybe not so common situation: My client needs to upload more than 90 files every first week of each month. How can I make it easier to him? Is there a way that I can make him choose a folder and then upload the files in it?

My regards,

Carlos Antonio

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities