RE: Renaming Files with CFFILE

2007-05-24 Thread Andy Matthews
A good alternative would be to resize the original to something just larger
than 100x150, say 105x150 or 100x154 (whichever site is longest), then crop
the remaining pixels to fit the intended size. Once the photo is that small
they're not going to notice much difference between 150 pixels and 154
pixels.

-Original Message-
From: Tom Chiverton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 24, 2007 10:21 AM
To: CF-Talk
Subject: Re: Renaming Files with CFFILE

On Thursday 24 May 2007, Andy Matthews wrote:
> If you resize an image to 100x150 it'll skew the ratio unless you crop it.

Easy and obvious solutions include resizing to something slightly different
(102x147) but with the same aspect, or using CSS to do the cropping if the
CF solution can't.

But yeah, clients are pains - nice to be have enough work that you can feel
you can drop them - means you have the power, not them !

--
Tom Chiverton
Helping to enormously innovate global ROI
on: http://thefalken.livejournal.com



~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279083
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Renaming Files with CFFILE

2007-05-24 Thread Tom Chiverton
On Thursday 24 May 2007, Andy Matthews wrote:
> If you resize an image to 100x150 it'll skew the ratio unless you crop it.

Easy and obvious solutions include resizing to something slightly different 
(102x147) but with the same aspect, or using CSS to do the cropping if the CF 
solution can't.

But yeah, clients are pains - nice to be have enough work that you can feel 
you can drop them - means you have the power, not them !

-- 
Tom Chiverton
Helping to enormously innovate global ROI
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.


~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279076
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Renaming Files with CFFILE

2007-05-24 Thread Andy Matthews
If you resize an image to 100x150 it'll skew the ratio unless you crop it. 

-Original Message-
From: Tom Chiverton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 24, 2007 10:02 AM
To: CF-Talk
Subject: Re: Renaming Files with CFFILE

On Thursday 24 May 2007, Les Mizzell wrote:
> "We just need to be able to export directly out of the camera. 

How did the ratio ever get broken then ?

--
Tom Chiverton
Helping to enormously deliver cross-media design-patterns
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.




~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279074
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Renaming Files with CFFILE

2007-05-24 Thread Tom Chiverton
On Thursday 24 May 2007, Les Mizzell wrote:
> "We just need to be able to export directly out of the camera. 

How did the ratio ever get broken then ?

-- 
Tom Chiverton
Helping to enormously deliver cross-media design-patterns
on: http://thefalken.livejournal.com



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.


~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279070
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Renaming Files with CFFILE

2007-05-24 Thread Les Mizzell
> The last I saw in this category was somebody who absolutely wanted to 
> enter several values in a text field using the Enter key in order to enter 
> several lines...

Mine was a client with an admin for their image gallery. It was set up 
for a main image and a thumb.

First round was my mistake. I trusted the client. WRONG!! I showed them 
how to use the system and how to properly size the images for use. The 
input fields *clearly* stated that the thumbs needed to be 100x150px and 
the main images could be no wider than 550px.

A week later, I get a phone call asking why their site isn't working and 
I find they've placed 20 or so full sized 3.5 to 6 meg images in as 
thumbnails! Their index page was weighing in at over 100 megs at this point!

I should have know better...

So, I rewrote it with the proper validation and file size checking as it 
should be. I immediately get an angry phone call - The admin isn't 
accepting our images!!".

"Have you sized them the way I showed you in your photo editing software?"

"We don't have time to edit anything. Make it so we can just put 
whatever we want in."

I went back in again and added imageCFC to take care of that. Which 
seemed to be working pretty good.

Another angry phone call. "Out thumbnails are DISTORTED!!!"

"Have you sized them correctly?"

"We told you we wanted the application to do that!"

"Well, they're getting sized to 100x150, so if you put something larger 
in there, at least the ratio needs to be 2/3 or it's going to 
proportioned incorrectly. I originally showed you how to use the 
application and you've got image editing software to do your sizing and 
optimization for you. You'll be much happier with the results if you do 
it that way."

"We just need to be able to export directly out of the camera. Got no 
time to fool with anything else. We've asked you to fix it. So FIX IT!"

I never could get the imageCFC "crop" function to work correctly for me, 
and even if i had, they wouldn't have been happy with how the crop was 
working.

Because of this and a number of other issues with the client, I finally 
"fired" them. Couldn't take any more...



~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279063
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Renaming Files with CFFILE

2007-05-24 Thread Claude Schneegans
 >>you put in place, somebody comes up with
*something* that mucks up the works and refuses to "do it right"

The last I saw in this category was somebody who absolutely wanted to 
enter several values
in a text field using the Enter key in order to enter several lines...
Of course, this submit the form instantly, thus the frustration ;-)

-- 
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279060
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Renaming Files with CFFILE

2007-05-24 Thread Bobby Hartsfield
There's all kinds of stuff available when you upload a file. 

cffile.serverFileExt will hold the extension

Dump #cffile# for the rest

#listlast(filename, ".")# will get you the extension too ;-)

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-Original Message-
From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 23, 2007 10:50 PM
To: CF-Talk
Subject: Renaming Files with CFFILE

It's so difficult accounting for every single "Stupid User Trick" that 
you often just want to run screaming off into the sunset at times. 
Regardless of what safeguards (client *and* server side validation, 
cfquery param, blah...blah) you put in place, somebody comes up with 
*something* that mucks up the works and refuses to "do it right" and 
your client says "YEs, that's stupid, but figure out how to deal with 
that!".

Now that I've got that off my chest...

I'm dealing with a CFFILE field. It accepts text, .doc, and .xls files. 
I do *not* want to accept the original file names, because folks are 
pretty much idiots and will name a file anything.

Here's one somebody tried to enter as a test today:

"Insurance Enroll. Info for Germany Partnership for Jason & Tommy..xls"

Yup, that whole line of text is an actual file name.

OK, I want to rename this with the record ID that goes into the 
database, so "397564.xls" looks great to me instead of the above.
Got no problem with the record ID part - how do I extract the correct 
file extension to tag onto the renamed file, since it can vary, and 
since it can look like something really stupid like the above .xls file?





~|
ColdFusion MX7 by Adobe®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279049
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Renaming Files with CFFILE

2007-05-23 Thread James Holmes
You can use listlast() with . as the delimiter.

On 5/24/07, Les Mizzell <[EMAIL PROTECTED]> wrote:

> OK, I want to rename this with the record ID that goes into the
> database, so "397564.xls" looks great to me instead of the above.
> Got no problem with the record ID part - how do I extract the correct
> file extension to tag onto the renamed file, since it can vary, and
> since it can look like something really stupid like the above .xls file?


-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279036
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Renaming Files with CFFILE

2007-05-23 Thread Les Mizzell
It's so difficult accounting for every single "Stupid User Trick" that 
you often just want to run screaming off into the sunset at times. 
Regardless of what safeguards (client *and* server side validation, 
cfquery param, blah...blah) you put in place, somebody comes up with 
*something* that mucks up the works and refuses to "do it right" and 
your client says "YEs, that's stupid, but figure out how to deal with 
that!".

Now that I've got that off my chest...

I'm dealing with a CFFILE field. It accepts text, .doc, and .xls files. 
I do *not* want to accept the original file names, because folks are 
pretty much idiots and will name a file anything.

Here's one somebody tried to enter as a test today:

"Insurance Enroll. Info for Germany Partnership for Jason & Tommy..xls"

Yup, that whole line of text is an actual file name.

OK, I want to rename this with the record ID that goes into the 
database, so "397564.xls" looks great to me instead of the above.
Got no problem with the record ID part - how do I extract the correct 
file extension to tag onto the renamed file, since it can vary, and 
since it can look like something really stupid like the above .xls file?



~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279035
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4