Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me
All your queries regarding
PHP Installation,
Binding Apache-PHP-MySQL,
and tonnes more... will be solved in this forum
  • Page:
  • 1
TOPIC:

File Uploading

File Uploading 1 year, 9 months ago #76

  • yoko
Hi..
I m trying to upload a file of 4MB and PHP is not allowing me to do that.
Can anyone guide me with this issue.
Last Edit: 1 year, 9 months ago by .

Re: File Uploading 1 year, 9 months ago #82

  • isaac
  • OFFLINE
  • Senior Boarder
  • Posts: 64
  • Karma: 0
Hi,

Where are you trying to upload the file???
on a webserver or a local box (on which apache, php and mysql is running)

Re: File Uploading 1 year, 9 months ago #83

  • yoko
I m trying to Upload file on my Local box.

This machine has apache, php and mysql running.

The following are the version installed on my box.
apache - 2.2.11
php - 5.2.9
mysql - 5.1.30 MySQL Community Server

Re: File Uploading 1 year, 9 months ago #89

  • isaac
  • OFFLINE
  • Senior Boarder
  • Posts: 64
  • Karma: 0
Go to C:\WINDOWS and locate php.ini file.

Open the file in any editor of your choice.

Locate File Uploads heading:

Under that find upload_max_filesize.

By default upload_max_filesize is 2M. Change 2M to 10M as shown below


; Maximum allowed size for uploaded files.
upload_max_filesize = 10M


Once the changes are made, save the php.ini file and RESTART APACHE.

Then Try to Upload your file again. It should work.

Re: File Uploading 1 year, 9 months ago #90

  • avan12
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
Hi,

I want to increase the size of file upload in using .htaccess file.

how do i do it?

Re: File Uploading 1 year, 9 months ago #99

  • isaac
  • OFFLINE
  • Senior Boarder
  • Posts: 64
  • Karma: 0
To create an htaccess file open notepad or any plain text editor and save the file as .htaccess, if using notepad make sure the file type is set to all files or you will create a txt file.

start with php_value which tells the server to expect a rule to follow

To increase the file size that can be uploaded use the rule upload_max_filesize followed by the file size in mega bite (MB)

Code:

#set max upload file size
php_value upload_max_filesize 20M
  • Page:
  • 1
Time to create page: 3.45 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download