I know this the the opposite of what most people ask, but I have implemented the AjaxFileUpload and it works fine with IE8. I wanted to allow multiple file uploads so I tried it in Chrome and Firefox. I click the add file on the web page and it opens the
add file dialog, but when I select a file, it doesn't add it to the list. It creates the drop area on the web page but when you drop files on it, nothing happens. In IE8, you can click the add files, select a file and it works great. What could be messing
with Chrome and Firefox?
Protected Sub AjaxFileUpload1_UploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs) Handles AjaxFileUpload1.UploadComplete
Dim CurrShip As String = Session("CurrShip")
Dim CurrClaim As String = Session("CurrClaim")
Dim path As String = "ValidPath\" & CurrShip & "\" & CurrClaim & "\"
If Not Directory.Exists(path) Then
Directory.CreateDirectory(path)
End If
Try
Dim fname() As String = Split(e.FileName, "\")
AjaxFileUpload1.SaveAs(path & fname(fname.GetUpperBound(0)))
Catch ex As Exception
Label1.ForeColor = Drawing.Color.Red
Label1.Text = "File could not be uploaded."
End Try
End Sub
The AjaxFileUpload control works with all browsers, even browsers which do not support the new XMLHttpRequest Level 2 standard. If you use the AjaxFileUpload control with a downlevel browser – such as Internet Explorer 9 — then you get a simple throbber
image during a file upload instead of a progress indicator.
I tried reverting to the May version but still to no avail. I have a throbber registered, but that is not the problem. It works fine with IE8. It doesn't work with Chrome and Firefox. It displays the control on hte web page, but when you select files
using the button or drag them to the control, it doesn't add them to the list. I looked at the PostBackTrigger idea, but that seems to be part of an update panel. I am using a standard panel, not an update panel. I even took the panel completely off the
page to see if that was causing a problem. I am still at a loss. I am wondering if it could be a security setting. I really don't see any security settings in Chrome. Does Chrome respect the IE security settings?
So I downloaded the latest toolkit to see if I could replicate your problem... and yes I can. I have not found an actual solution to the problem, but I did find out that it works fine if not using a master page.
I did use the asyncfileupload with success when having a master page... might be an option?
Thanks for taking the time to try that. I am glad its not just me. Will asyncfileupload allow you to select multiple files at the same time? My ultimate goal is to allow users to open a file select dialog and select multiple files and upload them. I
am a vb.net programmer that had a web project dropped in his lap. I am just learning about web pages, but what I have learned is that whatever I do, I will need to be able to write code in the codebehind file to be able to save the file to the correct location
and to add a sql database entry that tells the file is there. Most of the multiple upload solutions are in javascript and except for AJAXControlToolkit, I have had a lot of trouble getting the java to talk to the codebehind.
Still to no avail. I am wondering if it is a security setting in IIS maybe. I know we use HTTPS:// and we use the ASP.Net Forms Authentication. It is strange that the older versions of IE will work. It only does one file at a time, but it works. GOing
to think on it over the holiday. Happy 4th!
jwilcoxiii
0 Points
7 Posts
AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 02, 2012 08:25 PM|LINK
I know this the the opposite of what most people ask, but I have implemented the AjaxFileUpload and it works fine with IE8. I wanted to allow multiple file uploads so I tried it in Chrome and Firefox. I click the add file on the web page and it opens the add file dialog, but when I select a file, it doesn't add it to the list. It creates the drop area on the web page but when you drop files on it, nothing happens. In IE8, you can click the add files, select a file and it works great. What could be messing with Chrome and Firefox?
Code for Web page:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Upload.aspx.vb" Inherits="Claims_Upload" MasterPageFile="~/MasterPage.master" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <div style="padding: 10px; font-family: Arial, Helvetica, sans-serif; font-size: medium; font-weight: bold; font-style: normal; text-align: left; color: #3366CC;"> <br /> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><br /> <br /> <asp:Panel ID="Panel1" runat="server" GroupingText="File Upload" Width="450px" ForeColor="#3366CC"> <div style="padding: 8px; "> <ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server" width="100%" AllowedFileTypes="jpg,tif,pdf,bmp,png,gif" ThrobberID="MyThrobber" ContextKeys="MPS" ClientIDMode="Predictable" /> <asp:Image id="MyThrobber" ImageUrl="~/images/ajax-loader.gif" Style="display:None" runat="server" /><br /> <asp:Label ID="Label1" runat="server" Text=""></asp:Label><br /> </div> </asp:Panel> <br /> <asp:Button ID="btnDone" runat="server" Text="Done" Width="60px" /><br /> </div> </asp:Content>Code Behind is as follows:
Protected Sub AjaxFileUpload1_UploadComplete(sender As Object, e As AjaxControlToolkit.AjaxFileUploadEventArgs) Handles AjaxFileUpload1.UploadComplete Dim CurrShip As String = Session("CurrShip") Dim CurrClaim As String = Session("CurrClaim") Dim path As String = "ValidPath\" & CurrShip & "\" & CurrClaim & "\" If Not Directory.Exists(path) Then Directory.CreateDirectory(path) End If Try Dim fname() As String = Split(e.FileName, "\") AjaxFileUpload1.SaveAs(path & fname(fname.GetUpperBound(0))) Catch ex As Exception Label1.ForeColor = Drawing.Color.Red Label1.Text = "File could not be uploaded." End Try End SubAjaxControlToolkit
cornball76
Participant
1126 Points
210 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 02, 2012 09:30 PM|LINK
You have the latest version?
http://stephenwalther.com/archive/2012/05/01/ajax-control-toolkit-may-2012-release.aspx
That link discusses how the March is compatible with all the latest browsers.
AjaxControlToolkit
Specs
Member
612 Points
149 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 02, 2012 09:36 PM|LINK
It sounds like it might be an issue where the fileupload control needs a full postback:
<asp:PostBackTrigger ControlID="xxx" />
in <trigger>
http://forums.asp.net/t/1601068.aspx is a good thread further explaining.
AjaxControlToolkit
jwilcoxiii
0 Points
7 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 02, 2012 09:44 PM|LINK
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 03, 2012 03:23 AM|LINK
The AjaxFileUpload control works with all browsers, even browsers which do not support the new XMLHttpRequest Level 2 standard. If you use the AjaxFileUpload control with a downlevel browser – such as Internet Explorer 9 — then you get a simple throbber image during a file upload instead of a progress indicator.
http://stephenwalther.com/archive/2012/05/01/ajax-control-toolkit-may-2012-release.aspx
AjaxControlToolkit
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
jwilcoxiii
0 Points
7 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 03, 2012 01:53 PM|LINK
I tried reverting to the May version but still to no avail. I have a throbber registered, but that is not the problem. It works fine with IE8. It doesn't work with Chrome and Firefox. It displays the control on hte web page, but when you select files using the button or drag them to the control, it doesn't add them to the list. I looked at the PostBackTrigger idea, but that seems to be part of an update panel. I am using a standard panel, not an update panel. I even took the panel completely off the page to see if that was causing a problem. I am still at a loss. I am wondering if it could be a security setting. I really don't see any security settings in Chrome. Does Chrome respect the IE security settings?
AjaxControlToolkit
cornball76
Participant
1126 Points
210 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 03, 2012 05:24 PM|LINK
So I downloaded the latest toolkit to see if I could replicate your problem... and yes I can. I have not found an actual solution to the problem, but I did find out that it works fine if not using a master page.
I did use the asyncfileupload with success when having a master page... might be an option?
With that being said I have used http://code.google.com/p/swfupload/ before with success.
I'll dig some more and see if I can come up with anything else.
jwilcoxiii
0 Points
7 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 03, 2012 06:09 PM|LINK
Thanks for taking the time to try that. I am glad its not just me. Will asyncfileupload allow you to select multiple files at the same time? My ultimate goal is to allow users to open a file select dialog and select multiple files and upload them. I am a vb.net programmer that had a web project dropped in his lap. I am just learning about web pages, but what I have learned is that whatever I do, I will need to be able to write code in the codebehind file to be able to save the file to the correct location and to add a sql database entry that tells the file is there. Most of the multiple upload solutions are in javascript and except for AJAXControlToolkit, I have had a lot of trouble getting the java to talk to the codebehind.
cornball76
Participant
1126 Points
210 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 03, 2012 06:28 PM|LINK
I do not believe asyncfileupload allows for multiple.
Well being new it can be a headache I'm sure. You could use the following perhaps?
http://www.dotnetcurry.com/ShowArticle.aspx?ID=317
ANother that many people like is:
http://www.uploadify.com/
Usually well documented with examples.
jwilcoxiii
0 Points
7 Posts
Re: AjaxFileUpload doesn't work with Chrome or Firefox.
Jul 03, 2012 08:23 PM|LINK
I tried it as the following:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Upload.aspx.vb" Inherits="Claims_Upload" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <ajaxToolkit:AjaxFileUpload ID="AjaxFileUpload1" runat="server" AllowedFileTypes="jpg,tif,pdf,bmp,png,gif" ThrobberID="MyThrobber" /> <asp:Image id="MyThrobber" ImageUrl="~/images/ajax-loader.gif" Style="display:None" runat="server" /><br /> <asp:Button ID="btnDone" runat="server" Text="Done" Width="60px" /><br /> </form> </body> </html>Still to no avail. I am wondering if it is a security setting in IIS maybe. I know we use HTTPS:// and we use the ASP.Net Forms Authentication. It is strange that the older versions of IE will work. It only does one file at a time, but it works. GOing to think on it over the holiday. Happy 4th!
AjaxControlToolkit