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

Notification

Icon
Error

Options
Go to last post Go to first unread
dmoretti  
#1 Posted : Sunday, December 14, 2008 6:46:48 PM(UTC)
dmoretti

Rank: Newbie

Groups: Member
Joined: 11/27/2008(UTC)
Posts: 3

I'm getting this error on IE/ActiveX version whenever I try to call any method from the ImageUploader object. What I'm doing here basically is:

1. iu.fullPageLoadListenerName = "fullPageLoad";
3. var imageUploader = undefined;
3. function fullPageLoad() { imageUploader = getImageUploader("ImageUploader"); }
4. imageUploader.getUploadFileCount() or setUploadThumbnail1Height() won't work, that's when I get the error.

Everything works fine on Firefox/Java. I really don't know what I'm doing wrong, please help! Thanks in advance!

Code:
		<script language="javascript">
			var iu = new ImageUploaderWriter("ImageUploader", 670, 600);
			iu.activeXControlEnabled = true;
			iu.javaAppletEnabled = true;
			iu.activeXControlCodeBase = "../includes/ImageUploader/ImageUploader5.cab";
			iu.javaAppletCodeBase="../includes/ImageUploader/";

			// licencia
			iu.addParam("LicenseKey", "HIDDEN");

			// textos
			iu.addParam("ButtonAddToUploadListText", "Agregar");
			iu.addParam("ButtonAddAllToUploadListText", "Agregar Todas");
			iu.addParam("ButtonSelectAllText", "Seleccionar Todas");
			iu.addParam("ButtonDeselectAllText", "Deseleccionar Todas");
			iu.addParam("ButtonRemoveFromUploadListText", "Quitar");
			iu.addParam("ButtonRemoveAllFromUploadListText", "Quitar Todas");
			iu.addParam("ButtonSendText", "Enviar");
			iu.addParam("DropFilesHereText", "Arrastre las imágenes con el mouse a este sector");
			iu.addParam("SecondsText", "segundos");
			iu.addParam("MinutesText", "minutos");
			iu.addParam("HoursText", "horas");
			iu.addParam("RotateIconClockwiseTooltipText", "Rotar hacia la derecha");
			iu.addParam("RotateIconCounterclockwiseTooltipText", "Rotar hacia la izquierda");
			iu.addParam("RemoveIconTooltipText", "Quitar");
			iu.addParam("ProgressDialogCancelButtonText", "Cancelar");
			iu.addParam("ProgressDialogCloseButtonText", "Cerrar");
			iu.addParam("ProgressDialogCloseWhenUploadCompletesText", "Cerrar ventana al finalizar el envío");
			iu.addParam("ProgressDialogEstimatedTimeText", "Tiempo restante estimado");
			iu.addParam("ProgressDialogPreparingDataText", "Procesando foto");
			iu.addParam("ProgressDialogSentText", "Enviadas");
			iu.addParam("ProgressDialogTitleText", "Enviando sus fotos");
			iu.addParam("ProgressDialogWaitingForResponseFromServerText", "Esperando respuesta del servidor");
			iu.addParam("ProgressDialogWaitingForRetryText", "Reintentando");
			iu.addParam("MessageUploadCancelledText", "Envío cancelado");
			iu.addParam("MessageUploadCompleteText", "Envío finalizado");
			iu.addParam("MessageUploadCompleteText", "Error en el envío");
			iu.addParam("MessageBoxTitleText", "Información");
			iu.addParam("LargePreviewIconTooltipText", "Agrandar");

			// descripciones
			iu.addParam("FolderPaneShowDescriptions", "false");
			iu.addParam("ShowDescriptions", "false");
			iu.addParam("UploadPaneShowDescriptions", "false");

			// varios
			iu.addParam("FilesPerOnePackageCount", "1");
			iu.addParam("FileMask", "*.jpg;*.jpeg;*.jpe;*.png;*.gif;*.bmp");
			iu.addParam("QualityMeterFormats", "10x15,1024,768,1.33;13x18,1600,1200,1.33;15x20,2048,1536,1.33;20x30,2400,1800,1.33");
			iu.addParam("AllowLargePreview", "true");
			iu.activeXControlVersion = "5,7,14,0";
			iu.javaAppletCached = true;
			iu.javaAppletVersion="5.7.14.0";

			// thumbnails
			iu.addParam("UploadSourceFile", "false");
			iu.addParam("UploadThumbnail1FitMode", "Fit");
			iu.addParam("UploadThumbnail1Height", "640");
			iu.addParam("UploadThumbnail1Width", "640");
			iu.addParam("UploadThumbnail1JpegQuality", "90");
			iu.addParam("UploadThumbnail1ResizeQuality", "High");
			iu.addParam("UploadThumbnail2FitMode", "Fit");
			iu.addParam("UploadThumbnail2Height", "100");
			iu.addParam("UploadThumbnail2Width", "100");
			iu.addParam("UploadThumbnail2JpegQuality", "90");
			iu.addParam("UploadThumbnail2ResizeQuality", "High");

			// post
			iu.addParam("Action", "upload_do.php");

			// eventos
			iu.fullPageLoadListenerName = "fullPageLoad";
			iu.addEventListener("UploadFileCountChange", "SetStatusText");

			// go
			iu.writeHtml();

			// id
			var imageUploader = undefined;

			function fullPageLoad() {
				imageUploader = getImageUploader("ImageUploader");
				alert(imageUploader);
				setImageSize(1024);
			}

			function SetStatusText() {
				var statusText = "";
				var uploadCount = imageUploader.getUploadFileCount();
				if (uploadCount == 0) {
					statusText = "Aún no ha seleccionado fotos para enviar.";
				} else if (uploadCount == 1) {
					statusText = "Ha seleccionado 1 foto para enviar.";
				} else {
					statusText = "Ha seleccionado " + uploadCount + " fotos para enviar.";
				}
				$("#ImageUploaderStatusBar").html(statusText);
			}

			function setImageSize(size) {
				imageUploader.setUploadThumbnail1Height(size);
				imageUploader.setUploadThumbnail1Width(size);
				alert(imageUploader.getUploadThumbnail1Height());
			}

			function continuarCondicional() {
				var uploadCount = imageUploader.getUploadFileCount();
				if (uploadCount > 0) {
					alert("Aún no ha enviado sus fotos, por favor presione el botón \"Enviar\"");
				} else {
					window.location = "basket.php";
				}
			}

		</script>
Tamila  
#2 Posted : Monday, December 15, 2008 3:21:41 AM(UTC)
Tamila

Rank: Advanced Member

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

Was thanked: 1 time(s) in 1 post(s)
Hello,

As workaround I propose to you to set UploadThumbnail1Width / Height in BeforeUpload event listener:

Code:
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");

//...

function ImageUploader_BeforeUpload() {
	setImageSize("1024");
}

function setImageSize(size) {
        imageUploader.setUploadThumbnail1Height(size);
        imageUploader.setUploadThumbnail1Width(size);
        alert(imageUploader.getUploadThumbnail1Height());
}


Also in your code you wrote:
Code:
var imageUploader = undefined;

I recommend you to write:
var imageUploader = null;
or var imageUploader = getImageUploader("ImageUploader");
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
dmoretti  
#3 Posted : Monday, December 15, 2008 10:19:36 AM(UTC)
dmoretti

Rank: Newbie

Groups: Member
Joined: 11/27/2008(UTC)
Posts: 3

I need the user to change those values at runtime, so what I do is just set a default size and then let the user change it as he wishes. That's why I use FullPageLoad event, because I want it to fire just once.

Also, your second suggestion didn't work. What should I try now?
Tamila  
#4 Posted : Tuesday, December 16, 2008 2:42:34 AM(UTC)
Tamila

Rank: Advanced Member

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

Was thanked: 1 time(s) in 1 post(s)
Please see my reply in your case.
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
dmoretti  
#5 Posted : Tuesday, December 16, 2008 8:51:12 AM(UTC)
dmoretti

Rank: Newbie

Groups: Member
Joined: 11/27/2008(UTC)
Posts: 3

Thanks a lot Tamila, it worked perfectly! I could have never imagined that IE was case insensitive and Firefox case sensitive when it comes to ID names.
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.