Rank: Member
Groups: Member
Joined: 6/11/2007(UTC) Posts: 4
|
I need the ability to upload multiple folders and to preserve the folder structure on uploaded folders/files. According to your documentation this should be fairly simple to implement, but I have enabled the proper switches (as shown below) and it's not allowing folders to be uploaded. (see full code below). Code:iu.addParam("PaneLayout", "Three");
iu.addParam("FolderView", "Details");
iu.addParam("UploadView", "Details");
iu.addParam("ShowSubfolders", "true");
iu.addParam("AllowFolderUpload", "true");
Please let me know if there is something I am missing. Your help is greatly appreciated. Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Aurigma Image Uploader</title>
<script type="text/javascript" src="./iuembed.js"></script>
<link href="style.css" type="text/css" rel="stylesheet" />
<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_Progress(Status, Progress, ValueMax, Value, StatusText){
if (Status=="COMPLETE"){
//alert('Upload 100%');
window.location = 'upload2.php?order_id=<?=$order_id?>&order_type=<?=$order_type?>';
}
}
function ImageUploader_ViewChange(){
if (imageUploader1){
document.getElementById("selectView").selectedIndex = parseInt(imageUploader1.getFolderView());
}
}
function selectView_change(){
if (imageUploader1){
var selectView = document.getElementById("selectView");
imageUploader1.setFolderView(parseInt(selectView.options[selectView.selectedIndex].value));
}
}
//]]>
</script>
</head>
<body>
<strong>
Uploading Photos for Order #:
<?=$order_id?>
<b><?=$title?></b>
</strong>
<select id="selectView" onchange="selectView_change();">
<option value="0" selected="selected">Thumbnails</option>
<option value="1">Icons</option>
<option value="2">List</option>
<option value="3">Details</option>
</select>
<!-- This form contains total size of source files in the upload list. -->
<form id="Form1" name="Form1" action=".">
Total source file size:
<input id="TotalSourceFileSize" name="TotalSourceFileSize" type="text" readonly="readonly"
value="0" size="7" />
kb
</form>
<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "./ImageUploader4.cab";
iu.activeXControlVersion = "4,1,60,0";
//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletCodeBase = "./";
iu.javaAppletCached = true;
iu.javaAppletVersion = "2.1.60.0";
iu.showNonemptyResponse = "off";
//new features
iu.addParam("PaneLayout", "Three");
iu.addParam("FolderView", "Details");
iu.addParam("UploadView", "Details");
iu.addParam("ShowSubfolders", "true");
iu.addParam("AllowFolderUpload", "true");
//Configure appearance and behaviour.
//iu.addParam("PaneLayout", "OnePane");
//iu.addParam("UploadView", "List");
//iu.addParam("EnableRotate", "false");
//iu.addParam("ShowDebugWindow", "true");
//iu.addParam("ShowDescriptions", "false");
//iu.addParam("BackgroundColor", "#ffffff");
//iu.addParam("ShowSubfolders", "true");
//Allow upload not only files, but also entire folders.
//iu.addParam("AllowFolderUpload", "true");
//Drop Files Here Text
iu.addParam("DropFilesHereText", "Click Add Files or Add Folders button to add photos for this order. Click Send after all photos are added here.");
//Switch that indicates whether Image Uploader should remember the last visited folder.
//iu.addParam("RememberLastVisitedFolder", "true");
//Customize Image Uploader buttons.
iu.addParam("ButtonAddFoldersImageFormat", "Width=128;Height=25;UrlNormal='Images/AddFoldersNormal.png';UrlNormalFocused='Images/AddFoldersNormalFocused.png';UrlHover='Images/AddFoldersHover.png';UrlHoverFocused='Images/AddFoldersHoverFocused.png';UrlPressed='Images/AddFoldersPressed.png'");
iu.addParam("ButtonAddFilesImageFormat", "Width=109;Height=25;UrlNormal='Images/AddFilesNormal.png';UrlNormalFocused='Images/AddFilesNormalFocused.png';UrlHover='Images/AddFilesHover.png';UrlHoverFocused='Images/AddFilesHoverFocused.png';UrlPressed='Images/AddFilesPressed.png'");
iu.addParam("ButtonSendImageFormat", "Width=82;Height=25;UrlDisabled='Images/UploadDisabled.png';UrlNormal='Images/UploadNormal.png';UrlNormalFocused='Images/UploadNormalFocused.png';UrlHover='Images/UploadHover.png';UrlHoverFocused='Images/UploadHoverFocused.png';UrlPressed='Images/UploadPressed.png'");
//Configure Image Uploader to rotate photos automatically
//according to the orientation stored in EXIF metadata.
//iu.addParam("EnableAutoRotate", "true");
//Append the form with total file size to the upload.
//iu.addParam("AdditionalFormName", "Form1");
//Configure file mask to upload JPEG images only.
//iu.addParam("FileMask", "*.jpeg;*.jpg;*.jpe");
//Set image size restrictions.
iu.addParam("MinImageWidth", "5");
iu.addParam("MinImageHeight", "5");
//Exclude the source file from upload because only
//resized versions of the photo will be sent.
iu.addParam("UploadSourceFile", "false");
//Configure settings of the optimized image. Optimized image
//is resized to 1200x1200 with JPEG quality = 60 and EXIF
//metadata is preserved.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "1800");
iu.addParam("UploadThumbnail1Height", "1800");
iu.addParam("UploadThumbnail1JpegQuality", "60");
iu.addParam("UploadThumbnail1CopyExif", "true");
//Configure thumbnail settings.
iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "120");
iu.addParam("UploadThumbnail2Height", "120");
iu.addParam("UploadThumbnail2JpegQuality", "60");
//Configure URL files are uploaded to.
iu.addParam("Action", "upload.php?order_id=<?=$order_id?>&order_type=<?=$order_type?>");
//Add event handlers.
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
iu.addEventListener("ViewChange", "ImageUploader_ViewChange");
iu.addEventListener("Progress", "ImageUploader_Progress");
//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();
//]]>
</script>
</body>
</html>
Edited by user Friday, February 22, 2008 5:16:22 PM(UTC)
| Reason: Not specified
|