Rank: Advanced Member
Groups: Member
Joined: 4/24/2008(UTC) Posts: 31
|
Hi Eugene, Yes, I'm using the IU 5.1.10 version. Here's my embedding code: Code:
<script type="text/javascript">
<!--
//<![CDATA[
function fullPageLoad()
{
getImageUploader("ImageUploader1").RenameField("SourceFile_[ItemIndex]", "image");
getImageUploader("ImageUploader1").setAdditionalFormName("IPBform");
value = getImageUploader("ImageUploader1").getAdditionalFormName();
}
function ImageUploader1_BeforeUpload() {
getImageUploader("ImageUploader1").setButtonStopText("Stop");
needToHideButtonStop = false;
}
function ImageUploader1_Progress(Status, Progress, ValueMax, Value, StatusText) {
//Stop button should be displayed only during the upload process. If the upload
//completed (either successfully or not), the button should be hidden.
needToHideButtonStop = (Status=="COMPLETE" || Status=="ERROR" || Status=="CANCEL");
}
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 580, 180);
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "ImageUploader5.cab";
iu.activeXControlVersion = "5,1,10,0";
//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletJarFileName = "ImageUploader5.jar";
iu.javaAppletCodeBase = "assets/";
iu.javaAppletCached = true;
iu.javaAppletVersion = "5.1.10.0";
iu.showNonemptyResponse = "dump";
iu.addParam("AdditionalFormName", "");
//Set and configure advanced details view.
iu.addParam("PaneLayout", "OnePane");
iu.addParam("UploadView", "Thumbnails");
iu.addParam("DetailsPreviewThumbnailSize", "30");
iu.addParam("ShowButtons", "false");
iu.addParam("PaneBackgroundColor", "#ffffff");
//Configure License Keys
iu.addParam("LicenseKey", "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX; XXXXX-XXXXX-XXXXX-XXXXX-XXXXX");
//Configure upload settings.
iu.addParam("FilesPerOnePackageCount", "1");
iu.addParam("AutoRecoverMaxTriesCount", "1");
iu.addParam("AutoRecoverTimeOut", "10000");
iu.addParam("MaxConnectionCount", "3");
iu.addParam("AllowRotate", "true");
iu.addParam("AllowAutoRotate", "false");
if (iu.AddCookie) {
iu.AddCookie('session_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
}
//Set several URLs files should be uploaded to. In a real life most likely
//you will specify URLs to different servers, however in this demo the single
//server and page is used for brevity.
iu.addParam("Action", "http://mywebsite.com");
//Configure URL where to redirect after upload.
iu.addParam("RedirectUrl", "http://mywebsite.com/index.php?act=mylists&CODE=review_upload");
//Configure miscellaneous settings.
iu.addParam("ShowDebugWindow", "true");
iu.addParam("BackgroundColor", "#ffffff");
iu.addParam("ShowContextMenu", "true");
//Concurrent upload feature and advanced details view are not supported in Java version yet.
//This way we need to get Java version working in standard mode (sequential upload with standard
//progress dialog).
if (iu.getControlType() == "ActiveX"){
iu.addParam("SilentMode", "true");
var needToHideButtonStop = false;
iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");
iu.addEventListener("Progress", "ImageUploader1_Progress");
//Use timer to check whether to hide the Stop button. It allows to avoid the button flickering.
window.setInterval("if (needToHideButtonStop) {getImageUploader('ImageUploader1').setButtonStopText(''); needToHideButtonStop = false;}", 500);
}
iu.fullPageLoadListenerName = "fullPageLoad";
//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
//-->
</script>
|