Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

134
Vistas
Why can't I upload a video title with a video using php and plupload?

I'm trying to make a video uploading system with plupload that also takes a video title and puts it in a database. The video uploader works fine, but as soon as I try to add a separate input field for a title it doesn't work. I tried making a separate button for setting the title, but that didn't work either. Here's the HTML form:

<form id="uploadTitle" action="upload.inc.php" method="POST">
      <input type="text" name="title" placeholder="Video Title">
      <button class="browse" id="browse" href="javascript:;">Browse</button> 
      <button class="start-upload" id="start-upload" type="submit" href="javascript:;">Upload</button>
</form>

I have an error handler in my upload.inc.php:

if (empty($_FILES) || $_FILES['file']['error']) {
    die('{"OK": 0, "info": "Failed to move uploaded file."}');
}

It throws me this error every time I try to upload a video. I insert the file name / video url into the database just after plupload checks if the file has been uploaded and that works fine, so I modified it to also add the title:

$sql = "INSERT INTO videos(video_url, title)
        VALUES('$generatedName', '$title')";
mysqli_query($conn, $sql);
die('{"OK": 1, "info": "Upload successful."}');

Any help is appreciated!

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

If you are trying to upload a file first need to add the attribute enctype= multipart/form-data to the form, Then you need an input type file, don't forget the name attribute name='something'

about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda