Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

137
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda