error when upload media

Last post 04-17-2007, 7:08 AM by sanjayvishu. 6 replies.
Sort Posts: Previous Next
  •  03-15-2006, 12:52 AM 17203

    error when upload media

    I have changed the MaxMediaSize from 100 to 10000 in the configuration files and can upload a media file which is <4MB. But when I upload a file which is >4MB,it jumps to an error page, why????     In addition, it is in visual sdudio 2005.
     
  •  03-15-2006, 2:36 AM 17205 in reply to 17204

    Re: error when upload media

    Are these your answer? I can't understand. Who can help me ?
  •  03-15-2006, 2:42 AM 17206 in reply to 17205

    Re: error when upload media

    "The forum you requested does not exist. " I can't see it.
  •  03-15-2006, 10:58 AM 17240 in reply to 17206

    Re: error when upload media

    You may not realize it, but there is a limit to the size of a file that can be uploaded using this technique. By default, the maximum size of a file to be uploaded to the server using the File Field control is around 4MB. You cannot upload anything that is larger than this limit.

    One of the great things about .NET, however, is that it usually provides a way around limitations. You can usually change the default settings that are in place. To change this size limit, you make some changes in either the machine.config or web.config file.

    In the machine.config file, find a node called <httpRuntime> that looks like the following:

    <httpRuntime 
     executionTimeout="90" 
     maxRequestLength="4096"
     useFullyQualifiedRedirectUrl="false" 
     minFreeThreads="8" 
     minLocalRequestFreeThreads="4"
     appRequestQueueLimit="100"
    />

    A lot is going on in this single node, but the setting that takes care of the size of the files to be uploaded is the maxRequestLength attribute. By default, this is set to 4096 kilobytes (KB). Simply change this value to increase the size of the files that you can upload to the server. If you want to allow 10 megabyte (MB) files to be uploaded to the server, set the maxRequestLength value to 11264, meaning that the application allows files that are up to 11000 KB to be uploaded to the server.

    Making this change in the machine.config file applies this setting to all the applications that are on the server. If you want to apply this to only the application you are working with, then apply this node to the web.config file of your application, overriding any setting that is in the machine.config file. Make sure this node resides between the <system.web> nodes in the configuration file.

    Another setting involved in the size limitation of files to be uploaded is the value given to the executionTimeout attribute in the <httpRuntime> node.

    The value given the executionTimeout attribute is the number of seconds the upload is allowed to occur before being shut down by ASP.NET. If you are going to allow large files to be uploaded to the server, you are also going to want to increase this value along with the maxRequestLength value.

    One negative with increasing the size of a file that can be uploaded is that there are hackers out there who attack servers by throwing a large number of requests at them. To guard against this, you can actually decrease the size of the files that are allowed to be uploaded; otherwise, you may find hundreds or even thousands of 10 MB requests hitting your server.


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-15-2006, 7:37 PM 17260 in reply to 17240

    Re: error when upload media

    "File uploaded successfully."   Thank you very much!!!!
  •  04-17-2007, 7:08 AM 28483 in reply to 17260

    Re: error when upload media

    I am able to upload media file in database, when XHTML of cuteeditor is not saved it works fine at the moment when i used it, but when i displaying that similar XHTML text by using Literal conrol, the media file is not running.
     
    Is that i am doing something wrong, please tell me.
    Thank you
View as RSS news feed in XML