2.2.3 - PHP Upload Configuration

Top  Previous  Next

 

PHP.INI Configuration

 

Default installation of PHP comes with file upload enabled, but some vendors have disabled file upload for security reasons. Also, by default PHP has a LIMIT of 2 MB in upload and 8 MB in post size, changes are necessary.

 

Check the variables in your PHP.INI in C:\WINNT\ (windows 2000), C:\Windows\ (Win98/WinXP), etc.

 

file_uploads=On

upload_tmp_dir = C:/WINNT/Temp

upload_max_filesize=100M

post_max_size=100M

 

!!!NOTE!!!: For SOME Win32 systems, you are required to put the "/" at the end of the path.

upload_tmp_dir = "C:/WINNT/Temp/"

 

The above example has set the limit to 100 MB (default is 2 MB upload and 8 MB post size). Do not set it too big unless it is necessary.

 

YOU MUST RESTART APACHE to see the changes

 

For details about the configuration, refers to http://www.php.net/

 

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.

 

       sc_win_ntfs

 

 


Upload Testing

 

Option A:

 

If you have launched the SpeedCheck main page, you can click on the "Manual File Upload" link.

http://speedcheck.yourserver.com/SpeedCheck.php

 

sc_main_installation

 

Option B:

 

Open the page directly in your browser:

   http://speedcheck.yourserver.com/SpeedCheck_manual_upload.html

 

 

Upload testing:

 

Now, you should see this:

 

 

       sc_win_php_manual_upload

       

   To test if your server supports UPLOAD, click on "Manual Upload" link.

 

       sc_win_php_manual_upload_proc

 

   If you see "Upload successful",  your PHP 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.

 

sc_win_upload_folder

 

 

 

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

 

 

Troubleshooting

 

Please refer to Troubleshooting section.