|
Posted by ZeldorBlat on 09/08/06 13:45
mpar612 wrote:
> Thanks! The name of the <input> element is "song1." I see right where
> that mistake was and I changed it the revised code is listed below. I
> tested this and I still get the same errors.
>
> Any other thoughts? Thanks!
>
> Code:
> $filetypes = array ('image/gif', 'image/jpg', 'image/jpeg');
> if (in_array($_FILES['song1']['type'], $filetypes)){
> $audio_name = $_FILES['song1']['name'];
> $audio_uploaddir = "../Lounge/audio/$audio_dir_new/";
> if (move_uploaded_file($_FILES['song1']['tmp_name'],
> $audio_uploaddir.'/'.$audio_name)) {
> print("file upload was successful");
> } else {
> print("file upload failed");
> }
> } else {
> print "Please use an mpeg";
> }
Well, the code you have basically says the following:
If the uploaded file isn't a GIF or JPEG tell the user to use an MPEG.
See the problem now?
Navigation:
[Reply to this message]
|