|
2.3.3 - ASP.NET Upload Configuration |
Top Previous Next |
|
Web.Config Configuration
The default setting of ASP.net has a limit of 4MB upload size, edit "Web.Config" file in the Home Directory of your web site. The zip package comes with a Web.Config file. However if you have one on your web site already, you may have to edit it manually.
NOTE: Web.Config has to be put on the Home Directory (web root). If you are using sub-folder, please move the Web.Config file to the web root level.
This is partial configuration of the Web.Config file for tutorial purpose only, the completed version is included in the zip package.
<configuration> ........... existing configuration goes in here ........... <system.web> <httpRuntime maxRequestLength="51200" /> </system.web> ........... existing configuration goes in here ........... </configuration>
The default is 4096 = 4MB, you can change it to 8192 = 8MB, 51200 = 50 MB, etc.
Complete version of Web.Config:
<configuration> <appSettings> <add key="SC_Connection_String" value="SERVER=xxxxx;DATABASE=db_speedcheck;UID=xxxxx;PWD=xxxxx" /> <add key="SC_Statistics_Enabled" value="False" /> <add key="SC_Permission_Enabled" value="False" /> </appSettings> <system.web> <httpRuntime maxRequestLength="51200" /> <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" /> </system.web> </configuration>
NOTE: If you have installed URLScan/IIS Lockdown, please refer to Trouble Shooting section for special configurations.
Machine.Config Configuration
SpeedCheck Pro supports deleting file automatically after upload (requires changes in SpeedCheck_upload.aspx manually). To support this, machine.config has to be edited.
Search for the machine.config file in your c:\winnt (win2000) or c:\windows (winxp)
You may have multiple version of machine.config if you have upgraded your .NET framework. Open the latest version with text editor.
Search for username="machine" and replace it with username="SYSTEM"
You may have to restart IISAdmin and WWW Publishing Service in your Services control panel or in the command prompt, you can type: NET STOP and NET START (see screen shot)
NTFS Settings
The "upload" folder receives the file and writes to the hard drive, needs to make sure it has the right permission. We use "Everyone" for testing, you should tweak your security setting when deploying to the live server, you are responsible for your servers security.
Upload Testing
Option A:
If you have launched the SpeedCheck Pro main page, you can click on the "Manual File Upload" link. http://speedcheck.yourserver.com/SpeedCheck.aspx
Option B:
Open the page directly in your browser: http://speedcheck.yourserver.com/SpeedCheck_manual_upload.html
Upload testing:
Now, you should see this:
To test if your server supports UPLOAD, click on "Manual Upload" link and pick a file from your computer.
If you see "Upload successful", your ASP.NET is ready for upstream test.
Since "Delete File Automatically" is disabled by default, at this stage you should see your /upload folder and the file you just uploaded should be there. It is being renamed to be a text file for security reason.
Force Upload
In Version 5.5 and above, we introduced a feature called "Force Upload". The speed testing will continue to send data to the server even the server rejects the data (upload size limit setup on the server). To enable this feature, set Applet parameter to "1":
<param name="force_upload" value="1">
If this is enabled, and the upload data size is larger than your server limit, you will expect (1) To see error in your web server log (2) Physical file will NOT be written to the hard drive
|