PHP gurus... look here. Need help.  | |
May 21st, 2004, 12:17 AM
|
#1 (permalink)
| | Member
Join Date: May 2004
Posts: 184
| 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> |
| |
May 21st, 2004, 09:00 AM
|
#2 (permalink)
| | ph34r t3h g04t
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 19,573
|
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)? |
| |
May 21st, 2004, 10:06 AM
|
#3 (permalink)
| | Ultimate Member
Join Date: May 2002 Location: Stow, Ohio, Sol III
Posts: 1,199
|
Are these copyrighted files??  |
| |
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.
|
| |
May 21st, 2004, 01:06 PM
|
#5 (permalink)
| | Ultimate Member
Join Date: Jan 2002
Posts: 1,881
|
you have to set the limit higher than 2 MB in your php.ini file.
__________________
Got root?
|
| |
May 21st, 2004, 01:11 PM
|
#6 (permalink)
| | Member
Join Date: May 2004
Posts: 184
|
Last edited by VillageIdiot906 : May 21st, 2004 at 01:14 PM.
|
| |
May 21st, 2004, 01:14 PM
|
#7 (permalink)
| | Ultimate Member
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 |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |