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

Notification

Icon
Error

Options
Go to last post Go to first unread
lucl2000  
#1 Posted : Wednesday, March 28, 2007 5:27:42 AM(UTC)
lucl2000

Rank: Member

Groups: Member
Joined: 3/28/2007(UTC)
Posts: 3

I'm trying to allow our users to add a title and a story to each image.

For the title, I'm simply using the default "Edit Description" field which is easy but now I would like to add the second field for each photo which would allow members to add a story.

To do this I am using the AddField method which from what I read should do the trick. I added this code to my JavaScript but I don't see the new field... what am I doing wrong?

Code:
<script language="javascript" src="/bin/uploader/iuembed.js"></script>
<script language="javascript">

function beforeUploadHandler() {
    getImageUploader("ImageUploader").AddField("Story", " Edit story");
}

var iu = new ImageUploaderWriter("ImageUploader", 750, 600);


// If you do not want to use ActiveX or Java version, set the appropriate
// property to false.
iu.activeXControlEnabled = true;
iu.javaAppletEnabled = true;

iu.activeXControlCodeBase = "/bin/uploader/ImageUploader4.cab";
iu.javaAppletCodeBase="/bin/uploader/";

// ... initialize params as described in the next topic ...
iu.addParam("BackgroundColor", "#FFFFFF");

//Exclude the source file from upload because only 
//resized versions of the photo will be sent.
iu.addParam("UploadSourceFile", "false");

//Configure file mask to upload JPEG images only.
iu.addParam("FileMask", "*.jpeg;*.jpg;*.jpe;*.bmp;*.png;*.gif;*.wmv;*.avi;*.mpeg;*.mpg;*.mp3;*.mov");

//Configure settings of the optimized image. Optimized image
//is resized to 550 with JPEG quality = 75 and EXIF 
//metadata is preserved.
iu.addParam("UploadThumbnail1FitMode", "Width");
iu.addParam("UploadThumbnail1Width", "550");
iu.addParam("UploadThumbnail1Height", "2000");
iu.addParam("UploadThumbnail1JpegQuality", "75");

// Set a few UI customizations
iu.addParam("ButtonSendText", "Upload");
iu.addParam("EditDescriptionText", "Edit title ...");
iu.addParam("MaxDescriptionTextLength", "50");

// License
// iu.addParam("LicenseKey", "");

// Debug - Disable in Prod!
iu.addParam("ShowDebugWindow", "true");


// Set panel layout
iu.addParam("PaneLayout", "ThreePanes");

//Configure URL files are uploaded to.
iu.addParam("Action", "/cgi-bin/upload_img2.pl");

[b]iu.addEventListener("BeforeUpload", "beforeUploadHandler");[/b]

// As soon as you call this method, all necessary HTML code is inserted
// into the page on the current position. Alternatively, you can 
// get the string with appropriate HTML code using the getHtml method,
// and write it to the necessary position manually (maybe with some modifications).  
iu.writeHtml();
</script>

Edited by user Friday, February 22, 2008 2:06:16 AM(UTC)  | Reason: Not specified

George Ulyanov  
#2 Posted : Wednesday, March 28, 2007 8:14:43 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups: Member
Joined: 7/26/2006(UTC)
Posts: 203

Hello,

I have tried to run you code and got new field in the uploaded data.

Please check your code whether you actually process "Story" field. Also you can post your server code in order we checked where the problem can be.

Edited by user Friday, February 22, 2008 2:08:25 AM(UTC)  | Reason: Not specified

Best regards,
George Ulyanov
Users browsing this topic
Similar Topics
PHP version of Multiple Descriptions Sample or Uploading Additional Data (Discussions – ActiveX/Java Uploader)
by pbussey 5/26/2010 6:12:15 AM(UTC)
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.