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 gurus... look here. Need help.

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1575
Discussions: 200,988, Posts: 2,379,871, Members: 246,358
Old May 21st, 2004, 12:17 AM   Digg it!   #1 (permalink)
Member
 
Join Date: May 2004
Posts: 184
Arrow
PHP gurus... look here. Need help.

OK, for my web server, I'm setting up a file uploader and file manager. I made a form which uploads files to their folder space, but for some strange reason, doesn't upload songs. Anybody know why? Here's the code:

<?PHP

if ($_POST["submit"]) {
if ($_POST["MAX_FILE_SIZE"] >= $_FILES['uploadFile']['size']) {
copy ($_FILES['uploadFile']['tmp_name'], "../users/".$_REQUEST['username']."/".$_FILES['uploadFile']['name']);
} else {
echo ("File is too large: ".$_FILES['uploadFile']['size']);
}
}


?>

<HTML>

<HEAD>
<TITLE></TITLE>
</HEAD>

<link rel="stylesheet" href="../css/main.css">

<BODY>
<form action="" method="POST" ENCTYPE="multipart/form-data">
<table cellspacing="1" cellpadding="4">
<tr bgColor="#777CAB">
<td><font color="#EEEEEE">File: </font></td>
<td>
<input type="file" size="60" name="uploadFile">
<input type="hidden" name="MAX_FILE_SIZE" value="20000000">
</td>
<td align="right">
<input name="submit" type="submit" value=" Submit" style="width: 66px; height: 18px; font-family: Tahoma; text-align: left;">
</td>
</tr>
</table>
</form>

</BODY>

</HTML>
VillageIdiot906 is offline   Reply With Quote
Old May 21st, 2004, 09:00 AM     #2 (permalink)
ph34r t3h g04t
 
Whir's Avatar
 
Join Date: Oct 2001
Location: Kingsford, MI
Posts: 19,573
Blog Entries: 7
By music files, do you mean MP3s? And are you hosting this yourself, or using someone else? Perhaps the server itself won't allow MP3s to be uploaded (created)?
Whir is online now   Reply With Quote
Old May 21st, 2004, 10:06 AM     #3 (permalink)
Ultimate Member
 
nomaxim's Avatar
 
Join Date: May 2002
Location: Stow, Ohio, Sol III
Posts: 1,199
Are these copyrighted files??
nomaxim is offline   Reply With Quote
Old May 21st, 2004, 12:56 PM     #4 (permalink)
Member
 
Join Date: May 2004
Posts: 184
This is my server (Apache2). Whenever people try to upload, they have to wait a long time and then they get an error message (fatal error: something about 30 seconds). And yes, these are mp3. EDIT: I just realized that it is not just mp3's that do not upload, but any file over a certain file size (around 2mb).

Last edited by VillageIdiot906 : May 21st, 2004 at 01:02 PM.
VillageIdiot906 is offline   Reply With Quote
Old May 21st, 2004, 01:06 PM     #5 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
you have to set the limit higher than 2 MB in your php.ini file.
__________________
Got root?
e980238 is offline   Reply With Quote
Old May 21st, 2004, 01:11 PM     #6 (permalink)
Member
 
Join Date: May 2004
Posts: 184
Yay. Fixed. Thanks guys.

Last edited by VillageIdiot906 : May 21st, 2004 at 01:14 PM.
VillageIdiot906 is offline   Reply With Quote
Old May 21st, 2004, 01:14 PM     #7 (permalink)
Ultimate Member
 
e980238's Avatar
 
Join Date: Jan 2002
Posts: 1,881
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
e980238 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me set this stuff up thePh@r@oh General Tech Discussion 7 December 10th, 2003 02:05 PM
Outlook Express Rules. Epidemic General Tech Discussion 15 August 21st, 2003 08:44 PM
PHP Help TaStiEzs Webmastering and Programming 11 August 25th, 2002 06:37 AM
Linux and wine and M$ Office 2k implexant Applications and Operating Systems 18 August 17th, 2002 12:50 AM
Smoothwall configuration mickwish Networking and Internet 1 January 19th, 2002 09:44 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3067)
Charges against non-tippers dropped.. (20)
Health Care Rationing (11)
Delete an OS (17)
Nvidia GTX 260 problem (10)
Laptop with wireless problem. (12)
windows vista security holes (19)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
Regular Build (11)
Point and Shoot Camera Suggestions. (8)
windows 7 problem (7)
[F@H SPAM 11/16/09] ! 1/2 months to.. (39)
Internet Lost (5)
Recent Discussions
Desktop Calendar Application (2)
Looking for new motherboard (1)
soundmon.exe (8)
Jedi Academy Problem (3)
Can a page file be "too big".. (1)
Nvidia GTX 260 problem (10)
Point and Shoot Camera Suggestions. (8)
Size after cutting 700Mb file is 2.5 .. (0)
Delete an OS (17)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (39)
windows vista security holes (19)
updating BIOS via winflash, claims fi.. (1)
New Server Configuration Suggestions (0)
cheap gaming laptop? (12)
Unallocated Space (2)
help me pls laptop just stopped worki.. (1)
C# + LINQ Help (7)
Dynex DX E-402 (3)
EVGA 9800 gtx help with finding a goo.. (12)
Multiple Restarts Required at Boot (5)
cell phone won't work (0)
Is the PSU I received dead? (15)
Can't open Word (12)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)


All times are GMT -4. The time now is 07:27 AM.
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