Skip to main content
August 1, 2008
Question

Applicaition variable for Max Post Size?

  • August 1, 2008
  • 3 replies
  • 2397 views
I was wondering if there is an application variable that I can use to output the maximum file size to my upload form?
This topic has been closed for replies.

3 replies

Inspiring
August 7, 2008
Hi,

Another way of accomplishing this is,

Inspiring
August 7, 2008
Daverms wrote:
> Another way of accomplishing this is

If you have access to the Admin API, use Daverms' method. It is a better way to go.
Inspiring
August 6, 2008
That ColdFusion setting is stored in neo-runtime.xml. As a hack, you could extract the value from the file in your onApplicationStart method. Then store it in an application variable. Though there may be better ways of doing it.

<!--- set the default to unknown --->
<cfset postSizeLimit = "unknown">
<!--- read in the file --->
<cfset contents = FileRead( Server.ColdFusion.RootDir &"/lib/neo-runtime.xml")>
<cfwddx action="wddx2cfml" input="#contents#" output="settings">

<!--- search the settings for the post size key --->
<cfloop array="#settings#" index="data">
<cfif isStruct(data) AND structKeyExists(data, "postSizeLimit")>
<cfset postSizeLimit = data.postSizeLimit>
<cfbreak>
</cfif>
</cfloop>

<!--- display the final value --->
<cfoutput>
postSizeLimit = #postSizeLimit#
</cfoutput>
Participant
August 4, 2008
hi,
Log into the CF Administrator and click on the "settings" link. There are 3 new settings that apply here. The "maximum size of post data" is the one that you need to worry about. It limits the amount of data that can be posted to Coldfusion.
Maximum size of post data (MB) - Limits the amount of data that can be posted to the server in a single request. Coldfusion rejects single requests larger than the specified limit. The default value is 100 MB.
just try this.
August 5, 2008
I know where to change the value of the post size. Currently it is 100MB, but I was wondering if there was any way to get that value so i could display it on a page dynamically such as Application.MaxPostSize (for example). This will allow my page to be dynamic to the allowed post size.