Jump to content


Photo

Upload Script, NO size restriction!


  • Please log in to reply
13 replies to this topic

#1 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 29 September 2006 - 07:55 PM

i have a working php upload script, but it only allows about up to 7MB and then it just goes to the error.
i want it to NOT have ANY size restriction. but i havn't restricted any sizes!!!!
can anyone help me with this!?

<?php
//restricting file types i don't want to be uploaded:
$bad_types = array('application/octet-stream','application/x-php');
//if it's a bad file type, then display error:
if( in_array( $_FILES['uploadedfile']['type'], $bad_types ) )
{
    echo "That File type is not supported.";
}
else
{
//otherwise continue on the upload:
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
{
    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        echo "your file HAS been uploaded!";
    } else{
        echo "There was an error uploading the file, please try again!";
    }
}
}
?>


#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 29 September 2006 - 07:59 PM

There are 2 max size settings to consider

max file upload size
max post size
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#3 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 29 September 2006 - 08:02 PM

um ok....
well i want to set the max size for both very high. like 10GB.

#4 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 29 September 2006 - 08:04 PM

Both settings are in php.ini.

Max post needs to be > max file upload
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#5 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 29 September 2006 - 08:05 PM

php.ini ??
there is no such file...

#6 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 29 September 2006 - 08:07 PM

There is on my planet
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#7 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 29 September 2006 - 08:11 PM

where is it!?

#8 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 29 September 2006 - 08:12 PM

if you call phpinfo() the setting "Configuration File (php.ini) Path " (about 5 lines down) tells you where it's located
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#9 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 29 September 2006 - 08:16 PM

gotcha. ok i found it. so i need to change "Post" and "File" size? what line of code should i look for to change that? what does it look like?

#10 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 29 September 2006 - 08:19 PM

Search for

upload_max_filesize
post_max_size
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#11 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 29 September 2006 - 08:33 PM

I'm curious, why 10GB upload limit?  Does your webhost allow for such a high usage of bandwidth too?

Also if you're on a connection like OC48, uploading a file even remotely that large will take a really long time ;)

Crazy :)

#12 bholbrook

bholbrook
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 29 September 2006 - 09:01 PM

Most browsers have a maximum 500MB limit, so anything over that is useless.
make sure to put a hidden input named "MAX_UPLOAD_FILESIZE" with the value as the max size in bytes.

#13 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 30 September 2006 - 01:15 AM

so how do u increse the upload time?

#14 ShibSta

ShibSta
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 30 September 2006 - 02:00 AM

Could always use a java applet uploader.
Kinda hefty but it would work better than PHP for such a large file




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users