Rank: Newbie
Groups: Joined: 12/16/2009(UTC) Posts: 5
|
We have had several instances where the Safari browser (version 4.0.4) on Snow Leopard causes the browser window to close upon completion. It doesn't happen often, but it has happened enough times that we have tried discovering the cause. Currently, the only real change from the basic demo code is that we have added an AfterUpload event that redirects the user to our 'redirectUrl' after we had some problems with the "RedirectUrl" param breaking out of frames. Heres's a sample of our code: Code:
<script type="text/javascript">
//<![CDATA[
function ImageUploader_AfterUpload(Html) {
self.location.href = "<?php echo $redirectUrl ?>";
}
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 690, 400);
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "/uploader/ImageUploader6.cab";
iu.activeXControlVersion = "6,5,1,0";
//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletJarFileName = "ImageUploader6.jar";
iu.javaAppletCodeBase = "/uploader";
iu.javaAppletCached = true;
iu.javaAppletVersion = "6.5.1.0";
iu.showNonemptyResponse = "off";
//Configure appearance
iu.addParam("PaneLayout", "TwoPanes");
iu.addParam("ShowDebugWindow", "false");
iu.addParam("BackgroundColor", "#ffffff");
iu.addParam("AllowRotate", "false");
iu.addParam("DescriptionsReadOnly", "true");
iu.addParam("TreePaneWidth", "210");
iu.addParam("ButtonSendText", "Upload My Photos!");
iu.addParam("PreviewThumbnailSize", "120");
iu.addParam("PreviewThumbnailBorderHoverColor", "#83b4ff");
iu.addParam("CheckFilesBySelectAllButton", "true");
iu.addParam("ExtractExif", "ExifDateTime");
// image restrictions
iu.addParam("FileMask", "*.jpg;*.jpeg;*.jpe"); //Limit to jpeg images
iu.addParam("MaxFileSize", "15728640"); //15MB limit per image
//Exclude CMYK images
iu.addParam("AllowCmykImages", "false");
iu.addParam("MessageCmykImagesAreNotAllowedText", "You cannot upload CMYK images. Thanks!");
//Some limitations that should make things work better.
iu.addParam("FilesPerOnePackageCount", "12");
iu.addParam("MaxConnectionCount", "3");
//Configure License Keys
iu.addParam("LicenseKey", "<?php echo $this->uploaderKey ?>");
//Configure thumbnail settings.
iu.addParam("UploadThumbnail1FitMode", "Height");
iu.addParam("UploadThumbnail1Height", "450");
iu.addParam("UploadThumbnail1JpegQuality", "80");
iu.addParam("UploadThumbnail2FitMode", "Height");
iu.addParam("UploadThumbnail2Height", "48");
iu.addParam("UploadThumbnail2JpegQuality", "80");
iu.addParam("Action", "/photos/upload_aurigma?album=<?php echo $this->userAlbum->getUserAlbumID() ?>");
iu.addEventListener("AfterUpload", "ImageUploader_AfterUpload");
//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
</script>
|