|
-
Feb 22nd, 2007, 07:19 AM
#1
Thread Starter
Member
Uploading Problem
actully im having a problem of uploading heavy files via php. i can upload only files of 2 MB.
i saw some help about Uploading and made some changes in "php.ini" but still getting the same problem. how can i fix it?
the code goes here.
Form.Html
Code:
<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="6582272" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
Upload.php
Code:
<?php
$uploaddir = 'uploads/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
print "</pre>";
?>
Please keep away yourself from smoking
______________________
If you can't explain then don't write the hint because hint is always before when u have a problem. Okay? 
-
Feb 22nd, 2007, 09:27 AM
#2
Re: Uploading Problem
what did you change in the PHP ini? you need to change this line from 2M to something more like 7-10M:
PHP Code:
upload_max_filesize = 2M
make sure you've restarted your web server after making the changes to the ini file.
-
Feb 22nd, 2007, 10:03 AM
#3
Re: Uploading Problem
You might also have to change the web server's own upload limit.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 22nd, 2007, 11:32 AM
#4
Thread Starter
Member
Re: Uploading Problem
 Originally Posted by kows
what did you change in the PHP ini? you need to change this line from 2M to something more like 7-10M:
PHP Code:
upload_max_filesize = 2M
make sure you've restarted your web server after making the changes to the ini file.
thanks bro for ur reply i was not restarting my Server after making changes. but i also want to know. how much maximum
PHP Code:
upload_max_filesize = ??M
i can set?
actully while uploading songs which are 12 to 13 MB they are not uploading
 Originally Posted by kows
You might also have to change the web server's own upload limit
can u be more specific bro?
Please keep away yourself from smoking
______________________
If you can't explain then don't write the hint because hint is always before when u have a problem. Okay? 
-
Feb 22nd, 2007, 11:45 AM
#5
Re: Uploading Problem
Don't misattribute quotes.
PHP is not the only thing that can impose on file size limits. The web server (Apache or IIS, typically) also can have a maximum size for attachments. You should look at that configuration option, too.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 22nd, 2007, 08:40 PM
#6
Thread Starter
Member
Re: Uploading Problem
 Originally Posted by CornedBee
Don't misattribute quotes.
some times it happens boy.
well thanks for ya help.
kows bro do u have something which u think i must know ?
Please keep away yourself from smoking
______________________
If you can't explain then don't write the hint because hint is always before when u have a problem. Okay? 
-
Feb 23rd, 2007, 01:23 AM
#7
Re: Uploading Problem
 Originally Posted by guarav_raj420
print "Possible file upload attack! Here's some debugging info:\n";
Why would you show debugging info to someone that's trying to compromise your server?
Besides.. there's no such thing as an "attack" that move_uploaded_file will tell you about.
-
Feb 23rd, 2007, 06:17 AM
#8
Thread Starter
Member
Re: Uploading Problem
 Originally Posted by penagate
Why would you show debugging info to someone that's trying to compromise your server?
What if i want to see the Info myself? if does not matter what i show or not...
 Originally Posted by penagate
Besides.. there's no such thing as an "attack" that move_uploaded_file will tell you about.
Imfao the above code is copied from PhpManual
Please keep away yourself from smoking
______________________
If you can't explain then don't write the hint because hint is always before when u have a problem. Okay? 
-
Feb 23rd, 2007, 06:23 AM
#9
Re: Uploading Problem
Yes, it's copied from a user comment. There's a fair amount of rubbish in there.
-
Feb 23rd, 2007, 06:38 AM
#10
Thread Starter
Member
Re: Uploading Problem
 Originally Posted by penagate
Yes, it's copied from a user comment. There's a fair amount of rubbish in there.
if u already know then why u asked ?
Please keep away yourself from smoking
______________________
If you can't explain then don't write the hint because hint is always before when u have a problem. Okay? 
-
Feb 23rd, 2007, 07:05 PM
#11
Re: Uploading Problem
 Originally Posted by gaurav_raj420
if u already know then why u asked ? 
he wanted to know why you kept it there. lol. Mr Know it all
My usual boring signature: Something
-
Feb 24th, 2007, 04:49 AM
#12
Thread Starter
Member
Re: Uploading Problem
 Originally Posted by dclamp
he wanted to know why you kept it there. lol. Mr Know it all 
i think we should all come to the proper topic from where it was start.
Please keep away yourself from smoking
______________________
If you can't explain then don't write the hint because hint is always before when u have a problem. Okay? 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|