Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Tamila  
#1 Posted : Tuesday, May 27, 2008 9:41:10 PM(UTC)
Tamila

Rank: Advanced Member

Groups: Administration
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
As you know Image Uploader can send additional information along with files – for example, album title, author name, or whatever you need. Typically you use AdditionalFormName property to do it.

However, in some versions and under certain circumstances this property may not work. In this case we recommend using AddField method instead of AdditionalFormName. Let’s see how to do it.

For example, you send additional fields using the following code:
Code:

<form name="AdditionalData">
      <input name="author" value="Tamila" type="hidden">
	<input name="album_id" value="1234" type="hidden">
</form>

<!--… -->

<script>
var iu = new ImageUploaderWriter("ImageUploader", 600, 500);
// …
iu.addParam(“AdditionalFormName”, “AdditionalData”);
// …
iu.writeHtml();
</script>


Let’s rewrite it to use AddField method instead of AdditionalFormName. Just do the following:
  1. Delete all AdditionalFormName property entries.
  2. Add event listener for BeforeUpload event.
  3. In this event call AddField method for each field you want to send and pass name-value pair into it.
As a result we will have the following code:
Code:

<form name="AdditionalData">
      <input name="author" value="Tamila" type="hidden">
	<input name="album_id" value="1234" type="hidden">
</form>

<!--… -->

<script>
var iu = new ImageUploaderWriter("ImageUploader", 600, 500);
//…
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
//…
iu.writeHtml();

function ImageUploader_BeforeUpload() {
	getImageUploader("ImageUploader").AddField("author","Tamila");
	getImageUploader("ImageUploader").AddField("album_id","1234");

}
</script>


See Also:

Edited by user Wednesday, April 15, 2009 6:21:06 PM(UTC)  | Reason: Not specified

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
slin  
#2 Posted : Tuesday, July 15, 2008 1:33:25 PM(UTC)
slin

Rank: Newbie

Groups: Member
Joined: 7/15/2008(UTC)
Posts: 1

Quote:
However, in some versions and under certain circumstances this property may not work.


I don't mean to be rude, but this is something that really needs to go in the documentation for the AdditionalFormName property. I am currently evaluating the Image Uploader, and wasted about 4 hours trying to get AdditionalFormName to work properly in the Java version under Firefox 2.0.0.16 under WinXP.

After about 3.5 hours I tried a different browser (IE7) and realized it worked. That's when I figured it wasn't a problem with my Javascript and HTML but rather a problem with the Image Uploader, and after searching the forums I was able to find this post which solved the problem.

But, wow, what a non-fun experience. If it's known that this property doesn't always work, it seems to me it should either (in order):

1) Be fixed.
2) Be deprecated so that it's clear it should not be used.
3) At least have a note in the documentation saying it shouldn't be used!

I can only hope I don't discover any other surprises while working with this software.

Steve Lin
Dmitry  
#3 Posted : Tuesday, July 15, 2008 2:21:35 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Thank you for your feedback. We will do our best to fix the problem in the next versions.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Forum Jump  
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.