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

Notification

Icon
Error

Options
Go to last post Go to first unread
jgibbs  
#1 Posted : Wednesday, October 8, 2008 11:18:50 PM(UTC)
jgibbs

Rank: Advanced Member

Groups: Member
Joined: 9/22/2008(UTC)
Posts: 39

I seem to be getting the same title coming across for all of my image uploads...although the descriptions are not duplicate.

My script.js file portion looks like:

Code:
function addUploadFileHtml(index){
	var guid = "" + imageUploader1.getUploadFileGuid(index);
	var fileName = "" + imageUploader1.getUploadFileName(index);

	var h = "<table cellspacing=\"5\"><tbody>";
	h += "<tr>";
	h += "<td class=\"Thumbnail\" align=\"center\" valign=\"middle\">";

	//Add thumbnail control and link it with Image Uploader by its name and GUID.
	var tn = new ThumbnailWriter("Thumbnail" + uniqueId, 96, 96);
	//Copy codebase and version settings from ImageUploaderWriter instance.
	tn.activeXControlCodeBase = iu.activeXControlCodeBase;
	tn.activeXControlVersion = iu.activeXControlVersion;
	tn.javaAppletCodeBase = iu.javaAppletCodeBase;
	tn.javaAppletCached = iu.javaAppletCached;
	tn.javaAppletVersion = iu.javaAppletVersion;
	
	tn.activeXControlEnabled = iu.activeXControlEnabled ;
    tn.javaAppletEnabled = iu.javaAppletEnabled ;

	tn.addParam("ParentControlName", "ImageUploader1");
	tn.addParam("Guid", guid);
	tn.addParam("FileName", fileName);
	h += tn.getHtml();

	h += "</td>";
	h += "<td valign=\"top\">";

	//Add Title element.
	h += "Title:<br />";
	h += "<input id=\"Title" + uniqueId + "\" class=\"Title\" type=\"text\" /><br />";

	//Add Description element.
	h += "Description:<br />";
	h += "<textarea id=\"Description" + uniqueId + "\" class=\"Description\"\"></textarea>";

	h += "</td>";
	h += "</tr>";
	h += "<tr>";
	h += "<td align=\"center\"><a href=\"#\" onclick=\"return Remove_click('" + guid + "');\">Remove</a></td>";
	h += "<td></td>";
	h += "</tr>";
	h += "</tbody></table>";

	//Create DIV element which will represent the upload list item.
	var div = document.createElement("div");
	div.className = "UploadFile";
	div.innerHTML = h;
	div._guid = guid;
	//_uniqueId is used for fast access to the Title and Description form elements.
	div._uniqueId = uniqueId;

	//Append this upload list item to the custom upload pane.
	document.getElementById("UploadPane").appendChild(div);

	//Increase the ID to guaranty uniqueness.
	uniqueId++;
}

And then the ImageUploader_BeforeUpload function is:

Code:
function ImageUploader_BeforeUpload(){
	var guidIndexHash = getGuidIndexHash();

	var UploadPane = document.getElementById("UploadPane");

	for (var i = 0; i < UploadPane.childNodes.length; i++){
		var div = UploadPane.childNodes[i];

		var index = guidIndexHash[div._guid];

		//Description will be sent as a native Description POST field 
		//provided by Image Uploader.
		imageUploader1.setUploadFileDescription(index,
			document.getElementById("Description" + div._uniqueId).value);

		//Title will be sent as a custom Title_N POST field, where N is an 
		//index of the file.
		imageUploader1.AddField("Title_" + index, document.getElementById("Title" + div._uniqueId).value);
	}
}

Is there anything there that would cause a duplicate title to come across from the post field? If not, then it's gotta be my upload script, but I've double-checked taht over and over again.

Anyone?

jgibbs  
#2 Posted : Thursday, October 9, 2008 9:23:18 PM(UTC)
jgibbs

Rank: Advanced Member

Groups: Member
Joined: 9/22/2008(UTC)
Posts: 39

Anyone? I still have not figured out why this is happening. No matter how many images I upload, the Title field from the first image is the one getting pulled through and applied to all the images.

I keep rechecking my code in the upload page and it's all correct...I'm pulling the description for each image uploaded and it's working correctly. The title is the exact same thing except the only difference I can tell is that the title gets sent as a regular POST field and the Description gets sent as a native Image Uploader field. It's almost as if no custom POST fields are coming across unless it's specified through an additional custom form on the default.aspx page.

Is there any reason why the titles would not be coming across at all...and only the first title comes across and gets applied to all of them?

Edited by user Thursday, October 9, 2008 9:28:49 PM(UTC)  | Reason: Not specified

Dmitry  
#3 Posted : Sunday, October 12, 2008 7:47:59 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)
Hello,

As fas as I understand the problem is in you get the same title for all images sent by Image Uploader. Unfortunately it is not clear what is happening from your source. I do not see declaration of uniqueId variable and its initial value and so on. Could you prepare complete sample that reproduces your problem and send it to us?

Sincerely yours,

Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest
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.