Skip to content
Advertisement

how to upload all types of audio files to a folder using php

i have this web program, and i am uploading two types of files, one in image format and one in audio format, the image files are uploading perfectly and any type of image can work, but some audio files are not uploading, its not like a specific type of file eg. wav that is not uploading, just that some mp3 files will upload and other mp3 files would not;

here is the form

JavaScript

here is the javascript code

JavaScript

and here is the php

JavaScript

also i decided to see what the error was for myself so i printed the audio file of the screen and i saw that it had no type and no tmpname something like this:

JavaScript

i don’t know what the problem is, thanks for helping in advance

Advertisement

Answer

You have an error in your upload response [error] => 1

This is because you have selected a file that its size is bigger than your post_max_size or upload_max_filesize.

Increase these values from php.ini to a proper value and restart web server and PHP in your machine.

list of constants that you can use to detect errors while uploading files.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement