Welcome Guest Search | Active Topics | Members

Is it possible to set properties dynamically? Options
taokr
Posted: Wednesday, June 14, 2006 8:34:47 PM
Rank: Member
Groups: Member

Joined: 11/15/2005
Posts: 6
Points: 0
I was wondering if it's possible to set properties on the Image Uploader dynamically. What I mean is, can I have a button that when clicked, changes some of the properties, e.g. UploadThumbnail1FitMode.

My specific scenario is that by default my website resizes uploaded pictures on the server side to a maximum set of dimensions and several smaller thumbnails. However, on the upload page, there is a checkbox titled "Keep copies of the full-sized original images". When this is checked, the server also saves the original sized image in addition to the resized versions.

The way we've implemented it is that UploadThumbnail1FitMode is set to ActualSize and UploadThumbnail1JpegQuality is 100. The server then resizes Thumbnail1 into the appropriate sizes.

However, since users typically do NOT need to keep full-sized originals, it's a waste of bandwidth to send the actual sized image, particularly if the user has very big images. What I'd like to do is have Image Uploader resize the pic if the checkbox is not checked, and send the full-sized pic if it is checked.

The problem is, I think it's only possible to set properties like UploadThumbnail1FitMode once, at page load time. I don't see a way to dynamically set the property on an already-instantiated Image Uploader control.

Am I correct that this is not possible? And if so, any suggested workarounds?

Thanks,
Kevin
Fedor
Posted: Thursday, June 15, 2006 6:11:16 AM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,254
Points: -345
Location: WA, US
You can invoke almost all Image Uploader properties in runtime. Please read Customizing Image Uploader section for general information.

For example if you use ActiveX or Java version with iumbed.js file then you can achieve your task the following way:

Code:
getImageUploader("ImageUploaderID").setUploadThumbnail1FitMode("Off");


If you use ActiveX version without iumbed.js then you do it this way:

Code:
document.getElementById("ImageUploaderID").UploadThumbnail1FitMode = "Off";


Best regards,
Fedor Skvortsov
taokr
Posted: Thursday, June 15, 2006 12:30:01 PM
Rank: Member
Groups: Member

Joined: 11/15/2005
Posts: 6
Points: 0
Ah, fantastic! Thanks Fedor. I can't believe I missed that in the documentation.
Users browsing this topic
Guest


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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.