Portada » cargar archivo mp3 ejemplo de código php
Nuestro equipo de especialistas pasados varios días de investigación y de recopilar de información, obtuvieron la respuesta, queremos que todo este artículo sea de gran utilidad para tu proyecto.
Ejemplo 1: código de carga de archivos mp3 en php
< formclass = ' form1' action = ' ../inc/soundclips.php' method = ' post' enctype = ' multipart/form-data' > < inputtype = " hidden" name = " id" value = " echo $pid ; ?> " /> < b> Add Soundclip For < i> echo $e ; ?> i> b> echo "" ; echo "] ' />"; echo "
"
; ?> < br/> < b> Song
b> < br/> < inputtype = textsize = ' 60' name = ' asong' /> < br/> < inputname = ' file' type = " file" id = " file" /> < br/> < inputtype = ' submit' name = ' add' value = ' Add Soundclip' /> form>
Ejemplo 2: código de carga de archivos mp3 en php
$allowedExts = array ( "mp3" , "jpeg" , "jpg" , "png" ) ; $temp = explode ( "." , $_FILES [ "file" ] [ "name" ] ) ; $extension = end ( $temp ) ; if ( ( ( $_FILES [ "file" ] [ "type" ] == "audio/mp3" ) || ( $_FILES [ "file" ] [ "type" ] == "image/jpeg" ) || ( $_FILES [ "file" ] [ "type" ] == "image/jpg" ) || ( $_FILES [ "file" ] [ "type" ] == "image/pjpeg" ) || ( $_FILES [ "file" ] [ "type" ] == "image/x-png" ) || ( $_FILES [ "file" ] [ "type" ] == "image/png" ) ) && in_array ( $extension , $allowedExts ) ) if ( $_FILES [ "file" ] [ "error" ] > 0 ) echo "Return Code: " . $_FILES [ "file" ] [ "error" ] . " " ; else echo "Upload: " . $_FILES [ "file" ] [ "name" ] . " " ; echo "Type: " . $_FILES [ "file" ] [ "type" ] . " " ; echo "Size: " . ( $_FILES [ "file" ] [ "size" ] / 1024 ) . " kB " ; echo "Temp file: " . $_FILES [ "file" ] [ "tmp_name" ] . " " ; if ( file_exists ( "../soundclips/" . $_FILES [ "file" ] [ "name" ] ) ) echo $_FILES [ "file" ] [ "name" ] . " already exists. " ; else move_uploaded_file ( $_FILES [ "file" ] [ "tmp_name" ] , "../soundclips/" . $_FILES [ "file" ] [ "name" ] ) ; echo "Stored in: " . "../soundclips/" . $_FILES [ "file" ] [ "name" ] ; else echo "Invalid file" ;
Aquí puedes ver las comentarios y valoraciones de los lectores
Agradecemos que quieras corroborar nuestra labor añadiendo un comentario y valorándolo te lo agradecemos.
¡Haz clic para puntuar esta entrada!
Utiliza Nuestro Buscador