Page 1 of 1

help about big files upload via html form

Posted: Mon Oct 03, 2005 1:55 pm
by MysticRoad
hi guys
i have a problem in uploading a big file like .mp3 files (e.g 5 MB)
I'm using a "copy" function but no result it's failure !
Can u help me to do this ?
thx


feyd | posting does not require a size 18 font.

Posted: Mon Oct 03, 2005 2:03 pm
by feyd
you could easily be hitting the upload/post maximum sizes set for your installation.. check that all the ini config settings listed on the file uploading helper page are set correctly.

http://php.net/features.file-upload

Posted: Tue Oct 04, 2005 11:10 am
by MysticRoad
my hosting dont want to change upload max file size in php.ini
what can I do ?
I 'm traying with ftp functions
but I cant do it
can u help me ???
thx

Posted: Tue Oct 04, 2005 11:20 am
by chrys
MysticRoad wrote:my hosting dont want to change upload max file size in php.ini
what can I do ?
I 'm traying with ftp functions
but I cant do it
can u help me ???
thx
How do know the FTP functions are not working? Please provide more info

Posted: Tue Oct 04, 2005 11:26 am
by MysticRoad

Code: Select all

<?
$file = 'C:\AppServ\www\aparank\images\upimages\01.mp3';
$remote_file = '01.mp3';
$ftp_server='';
$ftp_user_name='';
$ftp_user_pass='';
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
print "successfully uploaded $file\n";
} else {
print "There was a problem while uploading $file";
}
ftp_close($conn_id);
?>
this is my source
I want to upload '01.mp3' to my server
can u show me my problems ?

Posted: Tue Oct 04, 2005 12:05 pm
by chrys
MysticRoad wrote:

Code: Select all

<?
$file = 'C:\AppServ\www\aparank\images\upimages\01.mp3';
$remote_file = '01.mp3';
$ftp_server='';
$ftp_user_name='';
$ftp_user_pass='';
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
if (ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) {
print "successfully uploaded $file\n";
} else {
print "There was a problem while uploading $file";
}
ftp_close($conn_id);
?>
this is my source
I want to upload '01.mp3' to my server
can u show me my problems ?
What is the output that you get from this code?

Posted: Tue Oct 04, 2005 12:08 pm
by MysticRoad

Code: Select all

Warning: ftp_put(C:\AppServ\www\aparank\images\upimages\01.mp3) [function.ftp-put]: failed to open stream: No such file or directory in /home/acxxnlkk/public_html/ftp2.php on line 14
There was a problem while uploading C:\AppServ\www\aparank\images\upimages\01.mp3

Posted: Tue Oct 04, 2005 12:11 pm
by chrys
MysticRoad wrote:

Code: Select all

Warning: ftp_put(C:\AppServ\www\aparank\images\upimages\01.mp3) [function.ftp-put]: failed to open stream: No such file or directory in /home/acxxnlkk/public_html/ftp2.php on line 14
There was a problem while uploading C:\AppServ\www\aparank\images\upimages\01.mp3
Unless the PHP script is running from your local computer... you can't upload anything from your local computer using these FTP functions. The FTP functions are designed to allow the machine that the code is being executed from to upload to another machine. That is why it can't find the file, because it doesn't exist.

Posted: Tue Oct 04, 2005 12:19 pm
by MysticRoad
ok dear freind
in this case what can I do to upload a big file from my local computer to the web hosting using a html form
when my hoster dont want to change a upload max file size in "php.ini" value !

Posted: Tue Oct 04, 2005 12:28 pm
by feyd
php.ini directives wrote:post_max_size "8M" PHP_INI_PERDIR PHP_INI_SYSTEM in PHP <= 4.2.3. Available since PHP 4.0.3.
------------
upload_max_filesize "2M" PHP_INI_PERDIR PHP_INI_ALL in PHP <= 4.2.3.
both state that you can change them on a per directory basis.. to using an .htaccess file you should be able to change it.

http://php.net/configuration.changes

Posted: Tue Oct 04, 2005 12:50 pm
by MysticRoad
I have input this code in .htaccess
upload_max_filesize "10M" PHP_INI_PERDIR PHP_INI_ALL
now my web site show internal server error 500 :cry:
can u explain me with more info ???????

Posted: Tue Oct 04, 2005 1:46 pm
by MysticRoad
I have try this

Code: Select all

<IfModule mod_php5.c>
php_value include_path ".:/usr/local/lib/php"
php_value upload_max_filesize 10M
</IfModule>
in .htaccess file
but its show again upload_max_filesize 2M in phpinfo()
what must I do ?

Posted: Tue Oct 04, 2005 1:59 pm
by neophyte
You're host really has PHP 5 in a shared environment? Didn't know you could get that... Look closely at your .htaccess directive.... Sorry I don't know the proper module name for PHP 4 offhand

Posted: Wed Oct 05, 2005 1:40 am
by MysticRoad
yes my host has php5 u can see it on http://mysticroad.com/info.php
what code must I write ?

Posted: Wed Oct 05, 2005 3:24 am
by phpdevuk
I found this little applet a while ago for handling multiple uploads at the same time, it pretty cool http://jupload.biz/en_2.html