Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Applicaition variable for Max Post Size?

Guest
Aug 01, 2008 Aug 01, 2008
I was wondering if there is an application variable that I can use to output the maximum file size to my upload form?
TOPICS
Getting started
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 04, 2008 Aug 04, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 05, 2008 Aug 05, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 05, 2008 Aug 05, 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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 06, 2008 Aug 06, 2008
Hi,

Another way of accomplishing this is,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 06, 2008 Aug 06, 2008
LATEST
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources