Page 1 of 1
File upload
Posted: Tue Apr 17, 2007 6:28 am
by kpraman
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?
Posted: Tue Apr 17, 2007 6:36 am
by Oren
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.
Posted: Tue Apr 17, 2007 6:51 am
by kpraman
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?
Posted: Tue Apr 17, 2007 7:00 am
by Oren
If you are on Apache, try to use .htaccess file to do that.
Posted: Tue Apr 17, 2007 7:24 am
by kpraman
Online server is not with me. How to alter through code?
Posted: Wed Apr 18, 2007 5:29 am
by Oren
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.