Shoutbox

PHP Uploading - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: PHP Uploading (/showthread.php?tid=39218)

PHP Uploading by DJeX on 02-27-2005 at 03:40 AM

I need some help here. I need a php script that will upload an mp3 to the server. But the thing is the server will only accept 2 mb files for uploading. How can I upload the mp3 in sections of 1.5 mb at a time? So when it gets done the mp3 is the full 4 mb and is on the server?

Any other sugestions or ways to get around this problem please feel free to tell me :P


RE: PHP Uploading by L. Coyote on 02-27-2005 at 03:58 AM

Get a file splitter. *-)

Or if you have access to the php.ini file, edit the upload size. :o


RE: PHP Uploading by ddunk on 02-27-2005 at 04:08 AM

Or possible zip/rar the file?


RE: PHP Uploading by SikStyles on 02-27-2005 at 04:10 AM

or get a better server :P


RE: PHP Uploading by DJeX on 02-27-2005 at 04:12 AM

no I don't have access to the php.ini (if I did I would not be psting here) and Ddunk I need the mp3 in full not in a zip.

quote:
Originaly posted by: SikStyles
or get a better server

ahh no. :)
RE: PHP Uploading by wj on 02-27-2005 at 04:13 AM

Without splitting or zipping it on the client end, theres really no way arround it because PHP limits it and there is no way to split it on the server durring file upload.


RE: PHP Uploading by DJeX on 02-27-2005 at 04:45 AM

Ok how about if I connect to the FTP with PHP?


Ok I tryed and the dam server don't have the PHP FTP access enabled. SOOO How about a CGI upload script? lol
RE: PHP Uploading by Chris.1 on 02-27-2005 at 12:49 PM

I'm sure I read somewhere about a way to overcome the PHP upload limit - it basically just looped over the upload statement or something. Not sure how it worked and I can't find the article again.


RE: PHP Uploading by DJeX on 02-27-2005 at 08:05 PM

How could I use ini_set to get past the limit?

http://www.php.net/manual/en/function.ini-set.php


RE: PHP Uploading by L. Coyote on 02-27-2005 at 08:11 PM

quote:
Originally posted by comments on that same page
Many settings, although they do get set, have no influence in your script.... like upload_max_filesize will get set but uploaded files are already passed to your PHP script before the settings are changed.

Also other settings, set by ini_set(), may be to late because of this (post_max_size etc.).
beware, try settings thru php.ini or .htaccess.

RE: PHP Uploading by Concord Dawn on 02-27-2005 at 08:26 PM

Just use another free hosting server? That's what I'm doing for my World of Warcraft Guild site. I'm uploading all the images and music and whatnot onto a free host, then using GuildPortal to put everything together. Why don't I just host the site on the free server? Because Guildportal allows me to do a bunch of things that I cannot do if I host my own site, such as ally with other guilds.


RE: PHP Uploading by DJeX on 02-27-2005 at 08:44 PM

Ok I figured out how to do it with the .htaccess file

you have to add this line to the .htaccess
php_value upload_max_filesize "5M"

You change the 5M to what ever amount you want to be able to upload.


RE: PHP Uploading by L. Coyote on 02-27-2005 at 08:58 PM

quote:
Originally posted by DJeX
Ok I figured out how to do it with the .htaccess file

you have to add this line to the .htaccess
php_value upload_max_filesize "5M"

You change the 5M to what ever amount you want to be able to upload.
Now that's very useful. :D Thanks for the tip!
RE: PHP Uploading by segosa on 02-27-2005 at 10:34 PM

Note, if you use PHP 4.3 (possibly other 4.x versions) it's php_flag instead of php_value.


RE: PHP Uploading by DJeX on 02-28-2005 at 12:04 AM

I use version 4.3.9 and it works fine.


RE: PHP Uploading by L. Coyote on 02-28-2005 at 12:23 AM

That's true. It works fine with php_value. :o Isn't it the other way around? php_flags for the older versions? It reminds me of a few years ago.


RE: PHP Uploading by segosa on 02-28-2005 at 07:16 AM

quote:
Originally posted by Leo
That's true. It works fine with php_value. :o Isn't it the other way around? php_flags for the older versions? It reminds me of a few years ago.

My server has 4.3.9 and php_value doesn't work, only php_flag :/
RE: PHP Uploading by WDZ on 02-28-2005 at 05:34 PM

php_flag is for changing boolean values, php_value is for everything else...

http://php.net/manual/en/configuration.changes.php