»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 12-15-2003, 10:34 AM   #1 (permalink)
Registered User
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,777
e980238 is on a distinguished road
php upload and execute?

Hi,

While I know there are many free programs to do this, a friend of mine still wants it done this way but I cannot get it to work on large files. Basically, he wants a web page to go to where he can upload a wav file and hit the convert button. Then php will execute lame using the system function to convert it to an mp3 file. I have gotten this to work for very small sound files (wav files that are < 1 MB or so). I have set the max upload file size to 200 MB and it still isnt working. If anyone has any ideas please let me know. Here is the code:

upload.php.php
Code:
<center>
<form enctype="multipart/form-data" action="convert.php" method="post">
    <h1>Choose a Wav file to convert to MP3:</h1><br> <input name="userfile" type="file" />
    <input type="submit" value="Convert" />
</form>

Convert.php
Code:
<?php
$uploadDir = '/tmp/';
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<center><pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
    print "File was successfully uploaded!<br><br>";
    echo "Converting file to mp3 ... please be patient";
    $convert = System("lame $uploadFile $uploadFile.mp3");
    echo "$convert";
    echo "<center><a href=/phpconvert$uploadFile.mp3><h1>Download File</h1></a>";
}
else
{
    echo "<center><h1>Something didn't work right!</h1>";
}
print "</pre>";
?>

__________________
Got root?
e980238 is offline   Reply With Quote
Old 12-15-2003, 11:11 AM   #2 (permalink)
Registered User
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,777
e980238 is on a distinguished road
Found out what the problem was...

the max post data size in php.ini was too small.
__________________
Got root?
e980238 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 04:32 PM.