PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
kpraman
Forum Contributor
Posts: 172 Joined: Fri Oct 13, 2006 10:54 am
Post
by kpraman » Tue Apr 17, 2007 6:28 am
I am trying to upload mpeg file which is 4 mb.
Code: Select all
copy($_FILES['course_file']['tmp_name'],"on_line_course/".$_FILES['course_file']['name']);
files which are lesser than 1 mb are uploading successfully.
Is it because of size or the format. If it is because of size, how to upload large files?
Oren
DevNet Resident
Posts: 1640 Joined: Fri Apr 07, 2006 5:13 am
Location: Israel
Post
by Oren » Tue Apr 17, 2007 6:36 am
First of all, take a look at:
move_uploaded_file()
As to the problem, check the value of
upload_max_filesize in your php.ini - the default is 2MB.
kpraman
Forum Contributor
Posts: 172 Joined: Fri Oct 13, 2006 10:54 am
Post
by kpraman » Tue Apr 17, 2007 6:51 am
I have changed the code to
Code: Select all
move_uploaded_file($_FILES['course_file']['tmp_name'],'on_line_course/'.$_FILES['course_file']['name']);
How to increase the default size in code?
In the site link you have given says, even the memory size has to be increased, how to do that?
Oren
DevNet Resident
Posts: 1640 Joined: Fri Apr 07, 2006 5:13 am
Location: Israel
Post
by Oren » Tue Apr 17, 2007 7:00 am
If you are on Apache, try to use .htaccess file to do that.
kpraman
Forum Contributor
Posts: 172 Joined: Fri Oct 13, 2006 10:54 am
Post
by kpraman » Tue Apr 17, 2007 7:24 am
Online server is not with me. How to alter through code?
Oren
DevNet Resident
Posts: 1640 Joined: Fri Apr 07, 2006 5:13 am
Location: Israel
Post
by Oren » Wed Apr 18, 2007 5:29 am
kpraman wrote: Online server is not with me.
What do you mean by that? That you can't change the server configuration?
I didn't tell you to change anything like that, just place an .htaccess file in the root.