The following are php configurations that must be considered when writing php program for uploading file to server:
- allow_url_fopen – should be on
- file_uploads – should be on
- upload_max_file_size – is the sum of the sizes of all the files that you are uploading. This should be larger than the files you are trying to upload.
- post_max_size – should be larger than the value that you set for upload_max_file_size.
- memory_limit – this directive has any effect only if you have used the –enable-memory-limit option at configuration time.
- upload_tmp_dir – should be a valid directory and have correct permissions for the server to write to.
- max_execution_time – should provide sufficient time.
Files are usually posted to the server in a format known as ‘multipart/form-data’.
<form method=”post” enctype=”multipart/form-data”>
Tips: if you are encountering file uploading trouble, first try uploading a small text file.
Be First To Comment
Related Post
Leave Your Comments Below