Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader And the Toolbar Options
Mark W
Posted: Saturday, February 12, 2011 2:27:19 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi
I am trying to use the toolbar with the AJAXUploader, in that I want to click a button on the toolbar and it uses the AJAXUploader.

I have looked through the sample, but its so tied into the editor etc.
Does any one have a really simple set of code just to get me going?
Vb code behind if possible

Many thanks

Mark
Mark W
Posted: Saturday, February 12, 2011 3:55:46 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Ok got it to work with a bit of paste and edit.
Not out of the wood yet, still need to get the progress bar in there some where.
Mark W
Posted: Saturday, February 12, 2011 5:24:35 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi again
I'm so nearly there with this,
every think is working just great except after I do a post back, the list of files that I prevoiusly uploaded is still displaying
I did use AJAXUploader1.ClearPostedFiles() on the button event, but this only removed the delete button.
If I do a second postback the file list is clear!
any Ideas how I clear the Posted Files list.


below is an example of the code
Many Thanks

Mark

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AJAXUploader1.TempFileLocation = MapPath("files/temp")
AJAXUploader1.FinalFileLocation = MapPath("files/public")
end sub

<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" />
<div>
<div id="uploader_div">
<eo:AJAXUploader ID="AJAXUploader1" runat="server" Width="250px" AutoPostBack="false">
<LayoutTemplate>
<div>
<asp:PlaceHolder ID="InputPlaceHolder" runat="server">Input Box Place Holder</asp:PlaceHolder>
<asp:Button ID="UploadButton" runat="server" Text="Upload"></asp:Button>
<eo:ProgressBar ID="ProgressBar" runat="server" ControlSkinID="Windows_XP">
</eo:ProgressBar>
<asp:PlaceHolder ID="ProgressTextPlaceHolder" runat="server">Progress Text Place Holder
</asp:PlaceHolder>
<asp:PlaceHolder ID="PostedFilesPlaceHolder" runat="server">Posted Files Place Holder
</asp:PlaceHolder>
<asp:Button ID="DeleteButton" runat="server" Text="Delete Selected Files"></asp:Button>
</div>
</LayoutTemplate>
</eo:AJAXUploader>
</div>
</div>
</form>
</body>
Mark W
Posted: Saturday, February 12, 2011 6:39:57 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Sorry this post is becoming more like a blog.
What I have found now is if I put a
Response.Redirect("default.aspx")
in the postback code it clears OK

Maybe thats what I should do?


eo_support
Posted: Sunday, February 13, 2011 12:06:55 PM
Rank: Administration
Groups: Administration

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

ClearPostedFiles should clear the file list. If it does not, please try to create a test page to duplicate the problem and post the test page. We will look into it as soon as we have that.

Another way to make sure you do not see the file list is to move the files away. You will need to handle the uploader's FileUploaded event and then loop through the AJAXUploader's PostedFiles property. For each posted file, you will get a temp file name. Make sure you "process" that temp file and then delete it (or move it away), that indicates you longer need the file and the AJAXUploader should no longer list it.

A Redirect will clear the list because it does a HTTP get thus discard all state information.

Thanks!
Mark W
Posted: Tuesday, February 15, 2011 4:51:17 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi
It would be great to know how to see this up properly.
This is a very simple example of how I can recreate this problem
When I click the button after adding files with the browse button
The file list still remains.

Many Thanks

Mark

<body>
<form id="form1" runat="server">
<div>

<eo:AJAXUploader ID="AJAXUploader1" runat="server" Width="250px">
</eo:AJAXUploader>

</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>



Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AJAXUploader1.TempFileLocation = MapPath("files/temp")
AJAXUploader1.FinalFileLocation = MapPath("files/public")
End Sub

eo_support
Posted: Tuesday, February 15, 2011 8:23:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
This is normal. It keeps the file list for you because you have neither called ClearPostedFiles nor moved/processed the temp file. We suggested both in our previous reply, so please make sure you have tried both methods first.

Thanks!
Mark W
Posted: Tuesday, February 15, 2011 8:33:37 AM
Rank: Member
Groups: Member

Joined: 2/6/2010
Posts: 22
Hi Support.

I'm sorry I did read that bit, but forgot to add the line, which as you say works a treat.
I then put the code into my product code, and Yes that works too, I was sure I did that before, but coundn't have done.

Thanks very much and sorry again for wasting your time.

Just as a side I love the way the toolbar works with the uploader, it look just great on my site.

All the best and thanks again

Mark


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.