Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
How to get the original source file when it is a non-image?
Rank: Member
Groups: Member
Joined: 2/23/2007(UTC) Posts: 9
|
I would like to upload images and have them resized with thumbnails. No problem - I got that part figured out.
Now I want to upload a non-image file. What will happen, exactly? Will it upload the original file anyway (even if I have UploadSourceFile = false)?
I need to know how to handle this, please.
Thanks!
|
Download Free ActiveX Controls Acitve-X.COM http://www.active-x.comLargest selection of free, downloadable ActiveX, ASP, and other Components
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 8/3/2003(UTC) Posts: 998
|
Hello,
If Image Uploader is unable to make a thumbnail for a file, it sends it’s system icon instead of thumbnail so if you set UploadSourceFile to false and set UploadThumbnail1FitMode to Fit, you will receive the JPEG-file which will contain the system icon in it instead of thumbnail. |
|
|
|
|
Rank: Member
Groups: Member
Joined: 2/23/2007(UTC) Posts: 9
|
OK... I want to be able to resize an image only if it is an image. But if it is not an image, I want to get the whole original file. Setting UploadSourceFile = True will upload large images, which I don't want. What is the best way to accomplish this?
Thank you.
|
Download Free ActiveX Controls Acitve-X.COM http://www.active-x.comLargest selection of free, downloadable ActiveX, ASP, and other Components
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 8/3/2003(UTC) Posts: 998
|
Hello, Try to use the following line of code (ActiveX version only): Code:iu.addParam("NonImagesThumbnailMode","SourceFile");
This will make Image Uploader to send the original file instead of system icon if it is unable to make a thumbnails for a file. |
|
|
|
|
Rank: Member
Groups: Member
Joined: 2/23/2007(UTC) Posts: 9
|
Thank you! I think we're getting close, but I still am unclear on something. First, here are my settings: Code:iu.addParam("UploadSourceFile", "true");
iu.addParam("NonImagesThumbnailMode", "SourceFile");
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "150");
iu.addParam("UploadThumbnail1Height", "150");
iu.addParam("UploadThumbnail1JpegQuality", "60");
On the server, I am using Dundas upload. The code is similar to this (I stripped it down for clarity): Code:For i = 1 to intFileCount
'Get first file
Set objFile = objUpload.GetNextFile
objFile.Save strDestPath
'Get thumbnail file
Set objThumbnail = objUpload.GetNextFile
objThumbnail.Save strDestPath
'...code to move from temp path to its final destination with new filename... (omitted from this post for clarity)...
Next
I tested uploading two files. One large image and one PDF file. The large image was uploaded in its original size, which was fine for now (I will change it later to upload to a fixed size). It also uploaded a thumbnail sized to fit in 150x150 - good. Then it uploaded the PDF file, but it did not upload the PDF's thumbnail file. I need it to upload the way it did, but also provide a thumbnail for the PDF file. Did I do something wrong? If UploadSourceFile = false, will the NonImagesThumbnailMode override this? Thank you. Edited by user Tuesday, December 18, 2007 4:03:06 PM(UTC)
| Reason: Not specified |
Download Free ActiveX Controls Acitve-X.COM http://www.active-x.comLargest selection of free, downloadable ActiveX, ASP, and other Components
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 7/26/2006(UTC) Posts: 203
|
Hi, Maybe this configuration will be more suitable for you: Code:iu.addParam("UploadSourceFile", "false");
iu.addParam("NonImagesThumbnailMode", "SourceFile");
iu.addParam("UploadThumbnail1FitMode", "ActualSize");
iu.addParam("UploadThumbnail1Width", "150");
iu.addParam("UploadThumbnail1Height", "150");
iu.addParam("UploadThumbnail1JpegQuality", "100");
======================================================== 02/23/2008, Fedor This samples is outdated
You should use UploadThumbnail1CompressionMode property now. ========================================================Edited by user Monday, February 25, 2008 6:00:52 PM(UTC)
| Reason: Not specified |
Best regards, George Ulyanov
|
|
|
|
Rank: Member
Groups: Member
Joined: 2/23/2007(UTC) Posts: 9
|
I am noticing that if NonImagesThumbnailMode = SourceFile, it will upload the same file for each thumbnail - each with "_Thumbnailx" appended to the end. This is bad because it doubles the upload time, plus it is unnecessary. If you have 3 thumbnails, it gets uploaded 3 times! If UploadSourceFile = true, then it gets uploaded yet another time!
Is NonImagesThumbnailMode a hidden property? I do not see any information in the Online Help about it.
George, your solution seems to work for me, however it is harder to detect what is coming to the server. For instance, I sent an EXE, a large image, and a PDF file and they were sent in that order. When examining the files that came in (using Dundas' upload component), I got the following: (intFileCount = 3): filename.exe_Thumbnail1, filename.jpg_Thumbnail1.jpg_Thumbnail1.jpg, and filename.pdf_Thumbnail1. I only got a file extension for the JPG. I can figure out the extension by stripping the _Thumbnail1 part, but why would it strip off the extension for non-image files?
I don't know if I want to implement your approach because of what I stated above about uploading the same file for each thumbnail (if it is not an image). I would rather just be able to upload the image with a set dimension such as 640x480. Then use the thumbnail properties for a thumbnail version such as 150x150 FIT. Then, for non-images, it still sends the original file plus an icon in the 150x150 thumbnail. Can't this be done?
There must be a better way than what we've been doing here. Maybe you need the following properties called "SourceImageWidth", "SourceImageHeight", "SourceImageJpegQuality" and "SourceImageMode" to specify the information for images, but still upload non-images in their native format. Any ideas?
|
Download Free ActiveX Controls Acitve-X.COM http://www.active-x.comLargest selection of free, downloadable ActiveX, ASP, and other Components
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 8/3/2003(UTC) Posts: 998
|
Hello,
This feature is in testing mode now so it is not documented. We will make some changes before it is released. |
|
|
|
|
Rank: Member
Groups: Member
Joined: 2/23/2007(UTC) Posts: 9
|
Great! I look forward to your next release... keep up the good work! :) |
Download Free ActiveX Controls Acitve-X.COM http://www.active-x.comLargest selection of free, downloadable ActiveX, ASP, and other Components
|
|
|
|
Rank: Member
Groups: Member
Joined: 4/8/2007(UTC) Posts: 2
|
My $0.02. The iu.addParam("NonImagesThumbnailMode", "SourceFile") should be defined at Thumbnail level, so that we have an ability to define for every thumb if we need the source file or not. Something like: Code:iu.addParam("NonImagesThumbnail1Mode", "SourceFile"); //Upload source file for non-image files
iu.addParam("NonImagesThumbnail2Mode", "Icon"); //Upload icon for non-image file
iu.addParam("NonImagesThumbnail3Mode", ""); //Upload nothing for non-image file
If you add the above feature into the next release you will make lots of people happy:-) I currently cannot add the second thumb cause I do not want to upload source files for non images again, but I REALLY need to use the second thumb, the first thumb in my case is just a resized copy of image files (resized to 800x600 for example) and the secound thumb would be a real thumb - a small picture 70x70 px. Edited by user Tuesday, December 18, 2007 4:05:42 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 8/3/2003(UTC) Posts: 998
|
Hello,
We are going to implement such kind of behavior in Image Uploader Dual 4.5. We are already working on it. |
|
|
|
|
Rank: Member
Groups: Member
Joined: 2/23/2007(UTC) Posts: 9
|
Hi,
So what is the final way to handle this in v4.5? Please include code.
Thanks!
|
Download Free ActiveX Controls Acitve-X.COM http://www.active-x.comLargest selection of free, downloadable ActiveX, ASP, and other Components
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 8/3/2003(UTC) Posts: 998
|
|
|
|
|
|
Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
How to get the original source file when it is a non-image?
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.