home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

php upload and execute?

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2316
Discussions: 200,942, Posts: 2,379,295, Members: 246,305
Old December 15th, 2003, 01:34 PM   Digg it!   #1 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
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 December 15th, 2003, 02:11 PM     #2 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
Found out what the problem was...

the max post data size in php.ini was too small.
e980238 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
The disrespect of Obama by Russian .. (5)
Is It Just Me? (2918)
Hackers global warming emails (5)
windows 7 problem (7)
Wireless Televisions. (11)
CPU fan stops spinning randomly (8)
Regular Build (6)
Is the PSU I received dead? (11)
HIS HD5770 graphic card question (15)
windows vista security holes (9)
Install XP pro and a Vista laptop ?.. (11)
Print spooler problem (13)
Foreign voltage (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
Recent Discussions
Wireless Televisions. (11)
Have you switched yet? (86)
Asus P4G8X Mobo (5)
screen resolution vs monitor size (2)
radeon x850xt platinum & shader 3 (4)
sms storage to PC (0)
Regular Build (6)
Open With ..... Win7 (0)
java code for fibonacci (1)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (35)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Partition Magic caused HDD problem (3)
Is the PSU I received dead? (11)
Point and Shoot Camera Suggestions. (2)
Modern Warfare 2 freeze (13)
wireless user (1)
World's largest Monopoly Game using G.. (332)
Ideal cheap graph card for PC-Gaming? (17)
BIOS won't read disk when I try to fl.. (0)
Install XP pro and a Vista laptop ?? (11)
Graphics Card Upgrade Question (1)
favorit (1)
solutions for virtical white lines on.. (1)
Fire in DVD (2)


All times are GMT -4. The time now is 04:15 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28