Welcome Guest Search | Active Topics | Sign In | Register

AjaxUploader not completing upload Options
Frances
Posted: Monday, June 17, 2013 2:47:09 PM
Rank: Newbie
Groups: Member

Joined: 6/17/2013
Posts: 2
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) + "&lt;br/&gt;");
          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.
eo_support
Posted: Tuesday, June 18, 2013 12:22:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Your code looks correct. If you try to upload the same file with our sample project (try to load sample project from the sample directory with Visual Studio and run it on your own machine), do you see the same problem?

Thanks!
Frances
Posted: Wednesday, June 19, 2013 1:14:24 PM
Rank: Newbie
Groups: Member

Joined: 6/17/2013
Posts: 2
I finally got that working on my machine, and the problem does not exist on my machine.
eo_support
Posted: Wednesday, June 19, 2013 3:52:42 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Another user reported a similar issue that you may want to take a look:

http://www.essentialobjects.com/forum/postst7655_Ajax-Uploader--not-fire-Autopostback-on-IE10.aspx

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.