Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
Franklin Cross #1
Limiting uploaded image width in user-posted content?
I have created a blogging system where users can upload pics to their
galleries then place them into their blogs by way of <img> tags. The problem
is, when the image is over 550 pixels in width, it blows up the tables in
the website. I have already warned them not to put huge images in the blogs
and have limited the filesize, but there is no way to stop people. Even
posting this warning it in bright red, super large text does not seem to put
a dent it in.
Is there a way to limit the width of an uploaded image?
If not, is there a way to scan for image tags with width greater than 550
and then replace the width attribute?
Franklin Cross Guest
-
Limiting Editing to specific page content
I bought this product for this specific reason from the Adobe sales literature: "With Adobe Contribute 4, site administrators can ensure that only... -
#40472 [NEW]: Semi random characters posted along with page content
From: fuitad at gmail dot com Operating system: FreeBSD PHP version: 5.2.1 PHP Bug Type: Output Control Bug description: ... -
Limiting table width?
I've noticed that tables have a way of horizontally wandering outside of their containing frames. Is there any way to limit and/or set a table's... -
rewriting posted content for use in redirect
similar to a recently asked question - The scenario is that posted data from World Pay is to be used to construct one of two pages depending on... -
limiting software installation to specific user(s)
Many software packages now ask, during installation, whether the installation is limited to the current user/installer or if it's for all users. ... -
Noël® #2
Re: Limiting uploaded image width in user-posted content?
"Franklin Cross" <CrossBaby111@hotmail.com> wrote in message
news:Deq9f.30859$ol.30690@fe08.lga...Something like this: (you might will need to set the:>I have created a blogging system where users can upload pics to their
>galleries then place them into their blogs by way of <img> tags. The
>problem is, when the image is over 550 pixels in width, it blows up the
>tables in the website. I have already warned them not to put huge images in
>the blogs and have limited the filesize, but there is no way to stop
>people. Even posting this warning it in bright red, super large text does
>not seem to put a dent it in.
>
> Is there a way to limit the width of an uploaded image?
>
> If not, is there a way to scan for image tags with width greater than 550
> and then replace the width attribute?
>
#ExpandPath('#ServerFile#')# )
<!--- :: Get image width and height --->
<cfobject type="JAVA" action="Create" name="tk" class="java.awt.Toolkit">
<cfobject type="JAVA" action="Create" name="img" class="java.awt.Image">
<cfscript>
img = tk.getDefaultToolkit().getImage("#ExpandPath('#Ser verFile#')#");
Width = img.getWidth();
Height = img.getHeight();
</cfscript>
<!--- :: Get image width and height :: --->
<cfif Width GT 550>
no no Width is to much!
<cffile action = "delete" file = "#ExpandPath('#ServerFile#')#">
</cfif>
<cfif Height GT 550>
no no Height is to much!
<cffile action = "delete" file = "#ExpandPath('#ServerFile#')#">
</cfif>
Noël® Guest



Reply With Quote

