The AJAXUploader is not completing the file upload correctly. For example, if I upload an image, only the top portion of the image uploads. Everything appears to have uploaded correctly, but opening the image on the server shows only the top portion.
I did not install on the server, just my machine. So, I copied the EO.Web.dll to the bin directory, and the eo_web.ashx file to the root directory of the website.
HTML Code:
Code: HTML/ASPX
<eo:CallbackPanel runat="server" ID="cp1" Triggers="{ControlID:au1;Parameter:}">
<eo:AJAXUploader runat="server" ID="au1" Width="400px" TempFileLocation="~/eo_upload" MaxDataSize="30000" OnFileUploaded="finishedUploading" AutoPostBack="true" AllowedExtension=".jpg|.pdf|.docx|.txt">
<LayoutTemplate>
<table cellspacing="0" cellpadding="2" width="520" border="0">
<tr>
<td width="99%">
<asp:PlaceHolder ID="InputPlaceHolder" runat="server">Input Box Place Holder</asp:PlaceHolder>
</td>
<td>
<asp:LinkButton ID="UploadButton" runat="server" Text="Upload" CssClass="ibutton100" >
<img src="img/buttons/icon_add.png" /><span>Upload</span>
</asp:LinkButton>
</td>
</tr>
<tr>
<td>
<eo:ProgressBar ID="ProgressBar" runat="server" ShowPercentage="True" IndicatorImage="img/EOImages/indicator.gif" BackgroundImageRight="img/EOImages/bg_right.gif" ControlSkinID="None" BackgroundImage="img/EOImages/bg.gif" IndicatorIncrement="7" BackgroundImageLeft="img/EOImages/bg_left.gif" Width="300px"></eo:ProgressBar>
</td>
</tr>
<tr>
<td colspan="3">
<asp:PlaceHolder ID="PostedFilesPlaceHolder" runat="server">Posted Files Place Holder</asp:PlaceHolder>
<asp:Button ID="DeleteButton" runat="server" Text="Delete Selected Files" />
<p>
</p>
</td>
</tr>
</table>
</LayoutTemplate>
</eo:AJAXUploader>
<asp:Label ID="lblStatus" runat="server" />
</eo:CallbackPanel>
Code Behind:
Code: C#
protected void finishedUploading(object sender, EventArgs e)
{
EO.Web.AJAXPostedFile[] files = au1.PostedFiles;
StringBuilder str = new StringBuilder();
foreach (EO.Web.AJAXPostedFile file in files)
{
str.Append(System.IO.Path.GetFileName(file.TempFileName) + "<br/>");
string tmpFileName = file.TempFileName;
string finalFilename = System.IO.Path.Combine(Server.MapPath("/test/"), file.ClientFileName);
System.IO.File.Move(tmpFileName, finalFilename);
}
lblStatus.Text = str.ToString();
}
As you can see I'm copying the uploaded file to a new folder and using the AJAXPostedFile functionality to save it as the original file type. I then open the file on the server itself.