Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader without file to upload Options
Corobori
Posted: Friday, November 21, 2008 4:42:29 AM
Rank: Member
Groups: Member

Joined: 7/12/2007
Posts: 24
I would like to use the AJAXUploader sample found inthis demo but with the difference that it will be part of a more extensive form where my user can upload or not. The think is that the upload button to trigger the postback only is activated when some file is specified. Any way of achieving this ?
eo_support
Posted: Friday, November 21, 2008 8:01:29 AM
Rank: Administration
Groups: Administration

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

You will need to use JavaScript to do that. The basic idea is to use your own upload button, then when user clicks the upload button, you start uploading by calling the uploader's upload method:

http://www.essentialobjects.com/ViewDoc.aspx?t=JSDoc.Public.AJAXUploader.upload.html

Thanks!
Corobori
Posted: Saturday, November 22, 2008 7:26:31 AM
Rank: Member
Groups: Member

Joined: 7/12/2007
Posts: 24
When you say "you own upload button". Is it any type of button ? I added one but the upload doesn't look to fire. The alert shown below do appear.

Quote:


<input ID="Button1" type="button" value="button" onclick="return Button1_onclick()" />

function Button1_onclick() {
alert('1')
var uploader = eo_GetObject("AJAXUploader1");
uploader.upload()
alert('2')
}
eo_support
Posted: Sunday, November 23, 2008 9:00:13 AM
Rank: Administration
Groups: Administration

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

We tested your code and it works fine here. Do you have the page online so that we can take a look?

Thanks
Corobori
Posted: Monday, November 24, 2008 2:52:25 PM
Rank: Member
Groups: Member

Joined: 7/12/2007
Posts: 24
You're right it was working but I didn't notice because I was expecting the AJAXUploader1_FileUploaded event to fire off but as I didn't have a file to upload this event wasn't triggered, which sounds pretty logic.


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.