Rank: Member
Groups: Joined: 9/25/2006(UTC) Posts: 10
|
Hi, I am using these 2 versions of IU: - ImageUploaderAx4058_CabOnly.zip - ImageUploaderJe2070_JarOnly.zip And here is the script from my page: Code:<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 550, 490);
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "javascripts/ImageUploader4.cab";
iu.activeXControlVersion = sc.activeXControlVersion;
//For Java applet only path to directory with JAR files should be specified (without file name).
//iu.javaAppletCodeBase = "javascripts/";
iu.javaAppletCodeBase = "../javascripts/";
//sc.javaAppletCodeBase = "M:/dev/haystack2/Haystack/public/javascripts/";
iu.javaAppletCached = true;
iu.javaAppletVersion = sc.javaAppletVersion;
iu.showNonemptyResponse = "off";
//Configure appearance and behaviour.
iu.addParam("PaneLayout", "TwoPanes");
iu.addParam("FolderView", "Details");
//iu.addParam("FolderView", "Details");
iu.addParam("UploadView", "Details");
iu.addParam("PreviewThumbnailSize", "100");
iu.addParam("ShowButtons", "false");
iu.addParam("ShowSubfolders", "true");
iu.addParam("ShowDescriptions", "false");
iu.addParam("ShowContextMenu", "true");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("AllowMultipleRotate", "true");
//Configure colors.
iu.addParam("PaneBackgroundColor", "#ffffff");
iu.addParam("BackgroundColor", "#ffffff");
iu.addParam("PreviewThumbnailActiveColor", "#f8b330");
iu.addParam("PreviewThumbnailInactiveColor", "#eeeeee");
//Hide tree pane.
iu.addParam("TreePaneWidth", "-1");
//Allow upload not only files, but also entire folders.
//iu.addParam("AllowFolderUpload", "true");
//Single or multiple file selection.
//iu.addParam("AllowMultipleSelection", "false");
//Link ImageUploader with ShellComboBox.
iu.addParam("AdditionalFolderNavigator", "ImageUploader1");
//Configure file mask to display images only.
iu.addParam("FileMask", "*.jpg;*.jpeg;*.jpe;*.gif;*.png;*.tif;*.tiff;*.psd");
// Config EXIF Settings
iu.addParam("ExtractExif", "ExifDateTime;ExifDateTimeOriginal;ExifCopyright;ExifGpsDateStamp;ExifGpsLatitudeRef;ExifGpsLatitude;ExifGpsLongitudeRef;ExifGpsLongitude;ExifImageDescription;ExifImageUniqueID;ExifOrientation;ExifRelatedSoundFile;ExifUserComment;ExifSubjectLocation;ExifSubjectArea;ExifMake;ExifModel;");
iu.addParam("ExtractIptc", "IptcByline;IptcCredit;IptcSource;IptcDateCreated;IptcCopyrightNotice;IptcCaption;IptcSpecialInstructions;IptcKeyword;");
//Configure thumbnail settings.
iu.addParam("UploadThumbnail1Width", "32");
iu.addParam("UploadThumbnail1Height", "32");
iu.addParam("UploadThumbnail1JpegQuality", "60");
//iu.addParam("UploadThumbnail1CopyExif", "true");
//Configure upload settings.
iu.addParam("Action", "upload");
iu.addParam("FilesPerOnePackageCount", "5");
iu.addParam("AutoRecoverMaxTriesCount", "3");
iu.addParam("AutoRecoverTimeOut", "10000");
//Configure Image Uploader to rotate photos automatically
//according to the orientation stored in EXIF metadata.
iu.addParam("EnableAutoRotate", "true");
//#TODO: source images are not rotated, thumbnails are
//Append the form with total file size to the upload.
//iu.addParam("AdditionalFormName", "Form1");
//Whichcraft Prepare
iu.addParam("UploadThumbnail1FitMode", "fit");
iu.addParam("UploadThumbnail1CopyExif", "true");
iu.addParam("AllowFolderUpload", "true");
iu.addParam("UncheckUploadedFiles", "false");
iu.addParam("UploadSourceFile", "false");
//Add event handlers.
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
iu.addEventListener("Progress", "ImageUploader_Progress");
iu.addEventListener("BeforeUpload", "ImageUploader_BeforeUpload");
iu.fullPageLoadListenerName = "FullPageLoad";
//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
//This UploadFileCountChange event handler displays total size of all files selected for upload.
function ImageUploader_UploadFileCountChange(){
var imageUploader1 = getImageUploader("ImageUploader1");
if (imageUploader1){
document.getElementById("TotalSourceFileSize").value = Math.ceil(imageUploader1.getTotalFileSize() / 1024);
}
}
//This Progress event handler demonstrates an alternative way to
//redirect upon upload (instead of RedirectUrl property).
function ImageUploader_send()
{
setTimeout("getImageUploader('ImageUploader1').Send()", 500);
}
var WasUpload = false;
//var WasUpload = true;
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText)
{
if (Status=="COMPLETE")
{
alert('preparing to filter selection list');
if (WasUpload)
{
WasUpload = false;
document.getElementById('btnUpload').innerHTML=('Find');
window.location = 'gallery';
return;
}
// Remove unwanted files from upload list
var iu = getImageUploader("ImageUploader1");
alert("Upload file count="+iu.getUploadFileCount());
value = getImageUploader("ImageUploader1").getUncheckUploadedFiles();
alert("UncheckUploadedFiles="+value);
/*
// During next upload source files will be sent
iu.setUploadSourceFile("true");
iu.setUncheckUploadedFiles("true");
iu.setUploadThumbnail1FitMode("Fit");
WasUpload = true;
document.getElementById('btnUpload').innerHTML=('SharePhotos');
*/
}
}
function ImageUploader_BeforeUpload() {
alert("Before upload event");
var iu = getImageUploader("ImageUploader1");
iu.setUncheckUploadedFiles("false");
value = getImageUploader("ImageUploader1").getUncheckUploadedFiles();
alert("UncheckUploadedFiles="+value);
alert("BeforeUpload file count="+iu.getUploadFileCount());
}
//]]>
</script>
Edited by user Tuesday, February 19, 2008 5:02:02 PM(UTC)
| Reason: Not specified
|