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

Notification

Icon
Error

Options
Go to last post Go to first unread
qchen  
#1 Posted : Tuesday, November 13, 2007 5:47:29 PM(UTC)
qchen

Rank: Member

Groups: Member
Joined: 11/13/2007(UTC)
Posts: 2

How to use Firefox to upload non-image files, such as pdf? What config shall I change?

The code seems only working with IE.

Code:
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../ImageUploader4.cab";
iu.activeXControlVersion = "4,1,21,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.30.0";

iu.showNonemptyResponse = "off";

//Configure appearance and behaviour.
iu.addParam("PaneLayout", "ThreePanes");
iu.addParam("FolderPaneHeight", "200");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("AllowMultipleRotate", "true");
iu.addParam("AllowMultipleRemove", "true");

//change text of send button
iu.addParam("ButtonSendText", "Upload");

//text description for each photo
iu.addParam("EditDescriptionText", "Edit...");  
iu.addParam("MaxDescriptionTextLength", "36");


iu.addParam("PreviewThumbnailSize", "64");
//iu.addParam("DeleteUploadedFiles", "true");
//iu.addParam("QualityMeterFormats", "4x6 inches,1800,1200,1.2;6x8 inches,2400,1800,1.25;"); 

//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;*.pdf;");

//Set image size restrictions.
iu.addParam("MinImageWidth", "250");
iu.addParam("MinImageHeight", "190");

//Exclude the source file from upload because only 
//resized versions of the photo will be sent.
//iu.addParam("UploadSourceFile", "false");

//iu.addParam("NonImagesThumbnailMode","SourceFile");
iu.addParam("UploadThumbnailNFallbackMode", "SourceFile");

//Configure settings of the optimized image. Optimized image
//is resized to 600x600 with JPEG quality = 60 and EXIF 
//metadata is preserved.
//iu.addParam("UploadThumbnail1FitMode", "Fit");
//iu.addParam("UploadThumbnail1Width", "250");
//iu.addParam("UploadThumbnail1Height", "190");
//iu.addParam("UploadThumbnail1JpegQuality", "90");
iu.addParam("UploadThumbnail1CopyExif", "true");

//Configure thumbnail settings.
iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "75");
iu.addParam("UploadThumbnail2Height", "75");
iu.addParam("UploadThumbnail2JpegQuality", "60");

iu.addParam("UploadSourceFile", "false");
iu.addParam("NonImagesThumbnailMode", "SourceFile");
iu.addParam("UploadThumbnail1FitMode", "ActualSize");
iu.addParam("UploadThumbnail1Width", "150");
iu.addParam("UploadThumbnail1Height", "150");
iu.addParam("UploadThumbnail1JpegQuality", "100");

//Configure user quota restriction. In real-life application these values should be 
//loaded from server.
//this restriction is at the client end, not the server end.
iu.addParam("MaxFileCount", "<%= iCount%>");
iu.addParam("MaxTotalFileSize", "52428800");
iu.addParam("MessageMaxFileCountExceededText", "You can only select <%=iCount%> photo for your profile.");

//Configure URL files are uploaded to.
iu.addParam("Action", "<%=GetUploadUrl()%>");

//Add event handlers.
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
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();

Edited by user Monday, February 25, 2008 1:06:28 PM(UTC)  | Reason: Not specified

George Ulyanov  
#2 Posted : Wednesday, November 14, 2007 1:31:05 PM(UTC)
George Ulyanov

Rank: Advanced Member

Groups:
Joined: 7/26/2006(UTC)
Posts: 203

Hello,

Please note that support of these properties in Java version is available since release 2.5.x only.

Also you should use UploadThumbnail1FallbackMode property instead of UploadThumbnailNFallbackMode one. In version 5.x we replaced this property with UploadThumbnail1CompressionMode one. Also don't use NonImagesThumbnailMode as it obsolete.

Edited by user Monday, February 25, 2008 1:18:54 PM(UTC)  | Reason: Not specified

Best regards,

George Ulyanov

qchen  
#3 Posted : Wednesday, November 14, 2007 4:25:49 PM(UTC)
qchen

Rank: Member

Groups: Member
Joined: 11/13/2007(UTC)
Posts: 2

Thanks George.

But I still not able to upload pdf file after I update the applet version and UploadThumbnail1FallbackMode instead of UploadThumbnailNFallbackMode. And remove the NonImagesThumbnailMode.

The file that was uploaded is the pdf system icon rather than original pdf source file.

Here is the updated source code:

Code:
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../ImageUploader4.cab";
iu.activeXControlVersion = "4,5,50,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.5.50.0";

iu.showNonemptyResponse = "off";

//Configure appearance and behaviour.
iu.addParam("PaneLayout", "ThreePanes");
iu.addParam("FolderPaneHeight", "200");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("AllowMultipleRotate", "true");
iu.addParam("AllowMultipleRemove", "true");

//change text of send button
iu.addParam("ButtonSendText", "Upload");

//text description for each photo
iu.addParam("EditDescriptionText", "Edit...");
iu.addParam("MaxDescriptionTextLength", "36");


iu.addParam("PreviewThumbnailSize", "64");
//iu.addParam("DeleteUploadedFiles", "true");
//iu.addParam("QualityMeterFormats", "4x6 inches,1800,1200,1.2;6x8 inches,2400,1800,1.25;");

//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;*.pdf;");

//Set image size restrictions.
iu.addParam("MinImageWidth", "250");
iu.addParam("MinImageHeight", "190");

//Exclude the source file from upload because only
//resized versions of the photo will be sent.
//iu.addParam("UploadSourceFile", "false");

//iu.addParam("NonImagesThumbnailMode","SourceFile");
iu.addParam("UploadThumbnail1FallbackMode", "SourceFile");
//iu.addParam("UploadThumbnail2FallbackMode", "SourceFile");

//Configure settings of the optimized image. Optimized image
//is resized to 600x600 with JPEG quality = 60 and EXIF
//metadata is preserved.
//iu.addParam("UploadThumbnail1FitMode", "Fit");
//iu.addParam("UploadThumbnail1Width", "250");
//iu.addParam("UploadThumbnail1Height", "190");
//iu.addParam("UploadThumbnail1JpegQuality", "90");
iu.addParam("UploadThumbnail1CopyExif", "true");

//Configure thumbnail settings.
iu.addParam("UploadThumbnail2FitMode", "ActualSize");
iu.addParam("UploadThumbnail2Width", "75");
iu.addParam("UploadThumbnail2Height", "75");
iu.addParam("UploadThumbnail2JpegQuality", "60");

iu.addParam("UploadSourceFile", "false");
//iu.addParam("NonImagesThumbnailMode", "SourceFile");
iu.addParam("UploadThumbnail1FitMode", "ActualSize");
iu.addParam("UploadThumbnail1Width", "150");
iu.addParam("UploadThumbnail1Height", "150");
iu.addParam("UploadThumbnail1JpegQuality", "100");

//Configure user quota restriction. In real-life application these values should be
//loaded from server.
//this restriction is at the client end, not the server end.
iu.addParam("MaxFileCount", "<%= iCount%>");
iu.addParam("MaxTotalFileSize", "52428800");
iu.addParam("MessageMaxFileCountExceededText", "You can only select <%=iCount%> photo for your profile.");

//Configure URL files are uploaded to.
iu.addParam("Action", "<%=GetUploadUrl()%>");

//Add event handlers.
iu.addEventListener("UploadFileCountChange", "ImageUploader_UploadFileCountChange");
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(); 

Edited by user Monday, February 25, 2008 1:19:18 PM(UTC)  | Reason: Not specified

Users browsing this topic
Similar Topics
Uploading Non-Image Files (Image Uploader)
by shaun_mcquaker 6/13/2007 10:28:56 PM(UTC)
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.